1
General Programming / HotTips : Delphi XE4
« เมื่อ: 27 เมษายน 13, 19:29:10 » สำหรับใครที่มีประสบการณ์ความรู้เขียนได้หลายๆภาษา
Delphi จึงไม่ใช่เรื่องยากที่จะเรียนรู้
ผมใช้เวลาศึกษา Delphi ไม่นานก็สามารถเขียนได้ไม่ยาก
บทความนี้เป็นทิปความรู้เบื้องต้น ไม่สามารถอธิบายคำสั่งต่างๆได้ทั้งหมด
---------------------------------------------------------------------------
Download : Delphi 2010 Click here
Download : Delphi XE4 Setup.exe Click here
Register Now : Delphi XE4 Programming by : sak2005

---------------------------------------------------------------------------

---------------------------------------------------------------------------
คำสั่ง : MessageBox แบบปกติ
คำสั่ง : MessageBox แบบเงื่อนไข
Delphi จึงไม่ใช่เรื่องยากที่จะเรียนรู้
ผมใช้เวลาศึกษา Delphi ไม่นานก็สามารถเขียนได้ไม่ยาก
บทความนี้เป็นทิปความรู้เบื้องต้น ไม่สามารถอธิบายคำสั่งต่างๆได้ทั้งหมด
---------------------------------------------------------------------------
Download : Delphi 2010 Click here
Download : Delphi XE4 Setup.exe Click here
Register Now : Delphi XE4 Programming by : sak2005

---------------------------------------------------------------------------

---------------------------------------------------------------------------
คำสั่ง : MessageBox แบบปกติ
โค๊ด: [Select]
procedure TForm1.FormCreate(Sender: TObject); //Event OnLoad StartCode.
begin //Start Statement code.
Application.MessageBox('Message : Hello World!', 'Title test', MB_OK); //MB_OK = 0
Form1.DisposeOf; //WinClose on Load.
end; //End Statement code.
end. //Event OnLoad EndCode.
ORโค๊ด: [Select]
procedure TForm1.FormCreate(Sender: TObject);
begin
with Application do
MessageBox('Message : Hello World!', 'Title test', MB_OK);
Form1.DisposeOf;
end;
end.
-----------------------------------------------------------------------------------------------------คำสั่ง : MessageBox แบบเงื่อนไข
โค๊ด: [Select]
procedure TForm1.FormCreate(Sender: TObject);
var btn : Integer; //Resault Operator
Begin
btn := Application.MessageBox('Presses.. Button', 'Title test', MB_YESNO + MB_ICONQUESTION); // MB_YESNO + MB_ICONQUESTION = 36
If btn = ID_YES Then //Resault Yes = 6
Application.MessageBox('Pressed..Yes', '')
else
Application.MessageBox('Pressed..No', '');
Form1.DisposeOf;
end;
end.ORโค๊ด: [Select]
procedure TForm1.FormCreate(Sender: TObject);
Begin
If Application.MessageBox('Pressed.. Button', 'Title test', MB_YESNO + MB_ICONQUESTION)= ID_YES Then
Application.MessageBox('Pressed..Yes', '')
else
Application.MessageBox('Pressed..No', '');
Form1.DisposeOf;
end;
end.











