Sep 8, 2003 #1 Spent Programmer Mar 20, 2003 100 BG Can you tell me how to set a hint on a Component in Delphi 5 so that the hint has more than one lines. Thanks
Can you tell me how to set a hint on a Component in Delphi 5 so that the hint has more than one lines. Thanks
Sep 8, 2003 #2 Svanhooft Programmer Nov 23, 2001 187 NL Hi, This a way to change your hint completly. Create a new project with and put a button on the form, Set the hint to True. And replace the code of unit one the code beneath: // start unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} type THintConFont = class(THintWindow) constructor Create(AOwner: TComponent); override; end; constructor THintConFont.Create(AOwner: TComponent); begin inherited Create(Aowner); Canvas.Font.Name := 'Times New Roman'; Canvas.Font.Size := 18; end; procedure TForm1.FormCreate(Sender: TObject); begin Button1.Hint := 'This is Line1'+#13#10+'This is Line2'; Application.ShowHint := False; HintWindowClass := THintConFont; Application.ShowHint := True; end; end. //end Run the application. Steph [Bigglasses] Upvote 0 Downvote
Hi, This a way to change your hint completly. Create a new project with and put a button on the form, Set the hint to True. And replace the code of unit one the code beneath: // start unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} type THintConFont = class(THintWindow) constructor Create(AOwner: TComponent); override; end; constructor THintConFont.Create(AOwner: TComponent); begin inherited Create(Aowner); Canvas.Font.Name := 'Times New Roman'; Canvas.Font.Size := 18; end; procedure TForm1.FormCreate(Sender: TObject); begin Button1.Hint := 'This is Line1'+#13#10+'This is Line2'; Application.ShowHint := False; HintWindowClass := THintConFont; Application.ShowHint := True; end; end. //end Run the application. Steph [Bigglasses]
Sep 9, 2003 #3 TonHu Programmer Dec 13, 2001 1,292 NL Just setting the hint to a text with #13#10 in it will do the trick s-) HTH TonHu Upvote 0 Downvote