2.
ճ :
E: . File/Save All.
C++Builder . ` WorkMain ( Unit1.cpp).
C++Builder . Work ( Project1.bpr).
C++Builder Work Form1. ij Caption .
Properties Object Inspector
- .
, , Caption Form1 Working with Application.
. .
.
.
Button ( Standard). , - . ` Button1. , `, Name Object Inspector ` CloseButton.
` ( ).
, Caption CloseButton. , Name Caption , Caption Close. :
CloseButton 䳿 OnClick:
//------------------------------------------------------- void __fastcall TForm1::CloseButtonClick(TObject *Sender) { Form1->Close(); } //------------------------------------------------------- |
. . .
CloseButton. Default true.
. <Enter>. , .
CloseButton. Cancel true.
. <Esc>.
`, Default Cancel true.
, .
Close. , Close CloseQuery, true. CloseQuery false, Close . CloseQuery true, OnClose .
|
|
TForm1 䳿 OnCloseQuery:
//--------------------------------------------------------------------------- void __fastcall TForm1::FormCloseQuery(TObject *Sender, bool &CanClose) { if(MessageDlg("Terminate the program?", mtConfirmation, TMsgDlgButtons() << mbYes << mbNo,0)==mrYes) CanClose=true; else CanClose=false; } //--------------------------------------------------------------------------- |
. . .
Label ( Standard) Button ( Standard).
:
Name | Caption | |
Label1 | TextLabel | Text |
Button1 | TextButton | Set |
. 3:
TextButton 䳿 OnClick:
//--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { Form1->TextLabel->Caption="New text"; } //--------------------------------------------------------------------------- |
.
ϳ .
, Borland C++ Builder | |
*.~* | . - . |
*.cpp | ++. . |
*.dfm | (form file). (*.res). ³ . *.dfm-. |
*.dsk | (desktop file). IDE ( ) . . |
*.exe | , . |
*.h | ++, . C++ Builder . |
*.il? | , <il> . (incremental linker) , , . |
*.obj | ` . ++. |
*.mak | . , , C++ Builder . |
*.res | , . |
:
1. Name ?
2. Caption ?
3. i i TDateTime ?
4. Now?
5. `?
6. ?
:
1: , TextButton .
2: , OnClick , ( Now TimeToStr).
3: , OnClick , .
|
|