本文整理汇总了C++中TForm::Free方法的典型用法代码示例。如果您正苦于以下问题:C++ TForm::Free方法的具体用法?C++ TForm::Free怎么用?C++ TForm::Free使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TForm
的用法示例。
在下文中一共展示了TForm::Free方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowAbout
//.........这里部分代码省略.........
lblAppName2->Font->Name = "Courier New";
lblAppName2->Font->Style = TFontStyles() << fsBold << fsItalic;
lblAppName2->Font->Size = iFontSize;
lblAppName2->Transparent = true;
lblAppName2->Layout = tlCenter;
lblAppName2->WordWrap = true;
} // pPicture == NULL
else {
TImage *imgPicture = new TImage(Form);
imgPicture->Parent = pnlName;
imgPicture->Align = alClient;
imgPicture->Picture->Assign(pPicture);
}
TLabel *lblDate = new TLabel(Form); // Date
lblDate->Parent = pnlName;
lblDate->Caption = sDate;
lblDate->Font->Assign(Form->Font);
lblDate->Font->Style = TFontStyles() << fsBold;
lblDate->Font->Color = clWhite;
lblDate->Font->Size = 8;
lblDate->Alignment = taRightJustify;
switch (3) {
case 0:
lblDate->SetBounds(2, 2, lblDate->Width, lblDate->Height);
break;
case 1:
lblDate->SetBounds(2, pnlName->ClientHeight - lblDate->Height - 2,
lblDate->Width, lblDate->Height);
break;
case 2:
lblDate->SetBounds(pnlName->ClientWidth - lblDate->Width - 2, 2,
lblDate->Width, lblDate->Height);
break;
default:
lblDate->SetBounds(pnlName->ClientWidth - lblDate->Width - 2,
pnlName->ClientHeight - lblDate->Height - 2, lblDate->Width,
lblDate->Height);
}
lblDate->Transparent = true;
TLabel *lblVerion = new TLabel(Form); // Version
lblVerion->Parent = pnlName;
lblVerion->Caption = sVersion;
lblVerion->Font->Assign(Form->Font);
lblVerion->Font->Style = TFontStyles() << fsBold;
lblVerion->Font->Color = clWhite;
lblVerion->Font->Size = 8;
switch (2) {
case 0:
lblVerion->SetBounds(2, 2, lblVerion->Width, lblVerion->Height);
break;
case 1:
lblVerion->SetBounds(2, pnlName->ClientHeight - lblVerion->Height - 2,
lblVerion->Width, lblVerion->Height);
break;
case 2:
lblVerion->SetBounds(pnlName->ClientWidth - lblVerion->Width - 2, 2,
lblVerion->Width, lblVerion->Height);
break;
default:
lblVerion->SetBounds(pnlName->ClientWidth - lblVerion->Width - 2,
pnlName->ClientHeight - lblVerion->Height - 2, lblVerion->Width,
lblVerion->Height);
}
lblVerion->Transparent = true;
TButton *btnClose = new TButton(Form);
btnClose->Parent = Form;
btnClose->Caption = "OK";
btnClose->ModalResult = mrCancel;
btnClose->Cancel = true;
btnClose->SetBounds(Form->ClientWidth - 83, Form->ClientHeight - 34,
75, 26);
btnClose->TabOrder = 0;
TTimer *timer = new TTimer(Form);
timer->OnTimer = AboutObject->TimerTimer;
timer->Interval = 1;
timer->Enabled = true;
RestoreCursor();
Form->Left = (Screen->Width - Form->Width) / 2;
Form->Top = (Screen->Height - Form->Height) / 2;
SetCurPosToCenter(btnClose);
Form->ShowModal();
Form->Free();
AboutObject->Free();
lblMemory = NULL;
lblProc = NULL;
lblMemoryValue = NULL;
lblProcValue = NULL;
}