PDA

View Full Version : ارائه یک تابع پیغام آسون براي استفاده



حرفه ای
سه شنبه 01 شهریور 1384, 15:26 عصر
procedure TF_Date.Msg( Titr,Payam : String );
var
Msglable:TLabel;
MsgHandle,Appsysmenu:THandle;
Bv1,Bv2:TBevel;
BBN:TBitBtn;
Begin
MsgFormB:=TForm.Create(Self);
With MsgFormB Do
Begin
Position:=poScreenCenter;
BorderStyle:=bsDialog;
BiDiMode:=bdRightToLeft;
Width:=340;
Height:=145;
KeyPreview:=True;
Caption:=Titr;
End;

MsgHandle:=MsgFormB.Handle;
Appsysmenu:=GetSystemMenu(Msghandle,False);
Flag:=MF_GRAYED;
EnableMenuItem(Appsysmenu,SC_CLOSE,MF_BYCOMMAND or Flag);

Bv1:=TBevel.Create(Self);
With Bv1 do
Begin
Top:=10;
Left:=10;
Width:=315;
Height:=95;
Visible:=True;
Parent:=MsgFormB;
End;
Bv2:=TBevel.Create(Self);
With Bv2 do
Begin
Top:=20;
Left:=20;
Width:=295;
Height:=75;
Visible:=True;
Parent:=MsgFormB;
Style:=bsRaised;
End;
Msglable:=TLabel.Create(Self);
With Msglable Do
Begin
AutoSize:=False;
Top:=20;
Left:=30;
Width:=278;
Height:=70 ;
Visible:=True;
Caption:=Payam;
Parent:=MsgFormB;
Font.Name:='Tahoma';
Font.Size:=8;
Font.Style:=[Fsbold];
Font.Color:=clBlack;
Alignment:=taCenter;
Transparent:=True;
WordWrap:=True;
Layout:=tlCenter;
End;
BBN:=TBitBtn.Create(Self);
with BBN do
Begin
Visible:=True;
Top:=80;
Left:=130;
Height:=30;
Width:=80;
Caption:='تـایـیـد ';
Font.Name:='Tahoma';
Font.Style:=[Fsbold];
Font.color:=clPurple;
Font.Size:=8;
Parent:=MsgFormB;
End;
MsgFormB.ActiveControl:=BBN;
BBN.OnClick:=BBNClick;
MsgFormB.ShowModal;
MsgFormB.Refresh;

End;

procedure TF_Date.BBNClick(Sender : Tobject);
Begin
MsgFormB.Close;
End; :sunglass: