Delphi tips :

Hints: color and timing; more than one line

 
Hints -- the little windows that are shown when moving the mouse cursor over a component or a menu item -- can be customized. You can change their color, their timing, and even show more than one line of text.


Color and timing of hints

In the OnCreate event handler of the main form of your application, write this code:

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.HintColor := clAqua;   // color of your choice
  Application.HintPause := 250;      // 250 mSec before hint is shown
  Application.HintHidePause := 3000; // hint disappears after 3 secs
end;

More lines in a Hint

If you want to display more than one line in the Hint of a component, for example Button1:

- In the Object Inspector, don't put anything in Button1's Hint property.
- Don't forget to set its ShowHint property to TRUE.

In the FormCreate event handler of the form that contains Button1, add this code:

Button1.Hint := 'First line'  + #13 + 'Second line' + #13 + 'Third line';         
  
 // ...add more lines as desired... 

DC Library  Forum Crash Course Delphi  Tips  Source Code  Downloads  Links