I made a similar tool tip recently. I think that it should not go out of 
your parent form edges because the parent form may be maximized and this 
will put your component not only out of parent form but also out of screen.
You just need to calculate if the hint (TMemo, etc) goes out of form and 
recalculate its Left property.

Also a new form will add a little bit more overhead to your program than 
a simple TControl.

JLIST wrote:
> Hello CubicDesign,
>
> Thanks for the reply. I am actually hoping that it'll look much
> better than a TMemo, and it's a form by itself so that it can go
> beyond the border of the main form, when the control is close
> to the border...
>
> Jack
>
> Friday, August 3, 2007, 1:02:14 PM, you wrote:
>
>   
>> I think you can do that by yourself.
>>     
>
>   
>> You need a TMemo to display the text.
>> In the OnClick event you make: Memo.Visible:= False;
>> You can auto size it according with the text length by using something
>> like this:
>>      Memo.Width:= Memo.Canvas.TextWidth('My text');    { I took this
>> from a program, you must adjust it to suit your needs. }
>>     
>
>   
>> I think you can do it in less than 50 lines of code.
>>     
>
>
>   
>> JLIST wrote:
>>     
>>> Hello all,
>>>
>>> I'm planning on placing a small TSpeedButton with a question mark
>>> beside a label, which is supposed to display a small tip window
>>> explain the content of this label when clicked. This way it's more
>>> obvious to the user than a tooltip. I wonder if anyone know of
>>> a good tip/message box control that looks good, hide itself when
>>> clicked on (and after a timeout), adjust size according to the
>>> content, and works on Vista and XP, and is free :) ?
>>>       
>
>
> _______________________________________________
> Delphi mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi
>
>   
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to