首页  编辑  

Edit控件的BalloonTip

Tags: /超级猛料/VCL/Memo&Edit&Richedit/Edit和Memo/   Date Created:

Edit控件的BalloonTip

//Windows +XP

//Form witch one button and one editbox

type

 tagEDITBALLOONTIP = record

   cbStruct: Longword;

   pszTitle: PWChar;

   pszText: PWChar;

   ttiIcon: Integer;

 end;

type

 PEDITBALLOONTIP = ^tagEDITBALLOONTIP;

const

 ECM_FIRST         = $00001500;

 EM_SHOWBALLOONTIP = ECM_FIRST + 3;

procedure TForm1.Button1Click(Sender: TObject);

var

 ebt: tagEDITBALLOONTIP;

 title, Text: Widestring;

 icon: Integer;

begin

 title := 'tooltip!!';

 Text  := 'in editbox :)';

 icon  := 1; //0,1,2,3

 with ebt do

 begin

   cbStruct := SizeOf(ebt);

   pszTitle := PWideChar(title);

   pszText  := PWideChar(Text);

   ttiIcon  := icon;

 end;

 SendMessage(Edit1.Handle, EM_SHOWBALLOONTIP, 0, Longint(@ebt));

end;