1. Home
  2. Computing & Technology
  3. Delphi Programming

Activate a control hint from code

By Zarko Gajic, About.com

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

Zarko Gajic
Guide since 1998

Zarko Gajic
Delphi Programming Guide

Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 2004 Delphi Tips
  7. Activate a control hint from code

©2009 About.com, a part of The New York Times Company.

All rights reserved.