1. Computing

Activate a control hint from code

From , former About.com Guide

Here's how to display a hint (tooltip) window for a control, from Delphi code:

~~~~~~~~~~~~~~~~~~~~~~~~~
procedure DoHint(AControl: TControl) ;
var
   pt: TPoint;
begin
   pt := AControl.ClientToScreen(Point(1,1)) ;
   SetCursorPos(pt.x, pt.y) ;
   Application.ActivateHint(pt) ;
end;

//Sample usage:
//Note: make sure ShowHint is set to True, and Hint property is assigned for Edit1! //DoHint(Edit1) ;
~~~~~~~~~~~~~~~~~~~~~~~~~

Delphi tips navigator:
» How to set the "home page" for the Internet Explorer from Delphi code
« How to execute a method (procedure/function) by name

©2013 About.com. All rights reserved.