关于Delphi的Hint

今天讲课的时候讲到了Application的OnHint事件,发现还是很多关于HINT的东西许多人不了解,随便GOOGLE了一下,摘录了一些:

1.一篇很好的关于HINT的文章。

Delphi的Hint入门指导

http://blog.csdn.net/cyai/archive/2008/02/22/2113744.aspx

这个文章对HINT进行了详细的描述,但是没有讲到GetShortHint和GetLongHint,下面的文章是对这个方面的补充。

 

2.这个是关于HINT的一个简短描述,写的很好。

Description

TApplication's Hint property is assigned the Hint value of the control or menu item that the mouse is currently moving over. It can also be assigned a string value that informs the user of some action, error, or other type of information. Therefore, use Hint either to:

Transfer hints from controls to another area of display, such as a status bar, using the OnHint event handler. This reads the Hint property.
Indicate the status of the application while it is processing some action. This sets the Hint property.

Help Hints appear when the OnHint event occurs. Therefore, if TApplication抯 Hint property is assigned to the status bar抯 caption, for example, the caption of the status bar control displays the current string value of the Hint property during an OnHint event.

There are two parts to the Hint string: short and long. Short hints are used by pop-up tool tips. Long hints are used by the status bar, separated by the | character. Use the global functions GetShortHint and GetLongHint, from the Controls unit to extract the long and short hints from a hint string.

Note: When setting Hint to a message informing the user of an event occurring in the application, remember that, by default, the Hint string is reset to a control抯 Hint when the mouse cursor moves over a control.

3.在DELPHI2009之后,增加了一个 TBalloonHint的控件,就不需要像1这样去自己写了,并且这个BOOLHINT长的还是挺漂亮的。

下面的文章就是对TBalloonHint的介绍,来之万一老师的BLOG

Delphi 2009 之 TBalloonHint

http://www.cnblogs.com/del/archive/2008/08/14/1267834.html

这个控件的原理还是基与前面HINT的介绍。

原文地址:https://www.cnblogs.com/barryhong/p/1421252.html