delphi实现起泡提示效果
Posted zyb2016
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了delphi实现起泡提示效果相关的知识,希望对你有一定的参考价值。
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
const
ECM_FIRST = $1500;
EM_SHOWBALLOONTIP = ECM_FIRST + 3;
EM_HIDEBALLOONTIP = ECM_FIRST + 4;
type
_tagEDITBALLOONTIP = packed record
cbStruct: DWORD;
pszTitle,
pszText : PWideChar;
ttiIcon : integer;
end;
TEditBalloonTip = _tagEDITBALLOONTIP;
type
TForm1 = class(TForm)
edit1: TEdit;
button1: TButton;
Memo1: TMemo;
procedure button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.button1Click(Sender: TObject);
var
ebt: TEditBalloonTip;
begin
with ebt do
begin
cbStruct := SizeOf(ebt);
pszTitle := ‘提示‘;
pszText := ‘请输入内容‘;
ttiIcon := 3; {NONE:0;INFO:1;WARNING:2;ERROR:3 不同状态}
end;
SendMessage(memo1.Handle,EM_SHOWBALLOONTIP,0,Longint(@ebt));
end;
end.
以上是关于delphi实现起泡提示效果的主要内容,如果未能解决你的问题,请参考以下文章