Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multilined Hint in Windows 98 ?

Status
Not open for further replies.

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

 
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]
 
Just setting the hint to a text with #13#10 in it will do the trick s-)

HTH
TonHu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top