Creating a custom prompt window

I am trying to find a way to use my second form as a tooltip for a component (like TLabel) in my first form.

I am currently studying the use of THintWindowand HintWindowClass, but cannot directly assign TFormto HintWindowClass. Some examples that I have seen so far use TBitmapwhich is then drawn on THintWindow.Canvas, which is not bad, but I would still like to use some kind of integrated automatic mechanism.

Another solution that occurred to me was to implement this functionality manually, using events OnMouseEnter, OnMouseMoveand the OnMouseLeavespecified Label.

If there is a way to β€œassign” TFormto HintWindowClass, I would like to ask if anyone can provide a piece of code illustrating this. Thank.

+5
source share
1 answer

THintWindowis a descendant TCustomControl. TFormis not a descendant of any of these classes, so you cannot assign a class TForm HintWindowClass. Tooltips should be lowered from THintWindow. Everything that you can put on the form, you can also put on THintWindow. You just need to instantiate it manually and assign its property Parentso that it displays.

, , "" , . THintWindow , ActivateHint ( ActivateHintData, ), .

+12

All Articles