procedure TCDM.FreeTipDialog;
begin
if TipForm<>nil then
TipForm.Close;
end;
procedure TCDM.MyClose(Sender :TObject;var Action:TCloseAction);
begin
TipForm:=nil;
Action:=caFree;
end;
procedure TCDM.CreateTipDialog(Tip:string);
begin
if TipForm=nil then
begin
//Application.CreateForm(TForm,TipForm);
TipForm:=TForm.Create(self);
with TipForm do
begin
OnClose:=MyClose;
BorderIcons:=[];
FormStyle:=fsStayOnTop;
BorderStyle:=bsSizeToolWin;
Font.Size :=10;
Font.Name :='宋体';
Position:=poScreenCenter;
ClientWidth:=40;//想多小
ClientHeight:=40;//
end;
TipLabel:=TLabel.Create(TipForm);
with TipLabel do
begin
Name:='Message';
Parent:=TipForm;
AutoSize:=true;
WordWrap:=True;
Caption:=Tip;
SetBounds(20,30,300,32);
end;
TipForm.Show;
TipForm.Update;
end;
end;