Mega Code Archive

 
Categories / Delphi / VCL
 

How to display hints of object on your forms title bar

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Memo1: TMemo; Button3: TButton; procedure FormCreate(Sender: TObject); private { Private declarations } public procedure ShowHint(Sender: TObject); { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin application.OnHint:=ShowHint; Button1.Hint:='This is Button 1'; Button2.Hint:='This is Button 2'; Button3.Hint:='This is Button 3'; Memo1.Hint:='This is Memo1'; end; procedure TForm1.ShowHint(Sender: TObject); begin Caption:= application.Hint; end; end.