StdCtrlsProp (C++)
Description
This example demonstrates the use of some properties available for TButton, TComboBox, TEdit, TLabel and TMemo objects.
Code
__fastcall TMainForm::TMainForm(TComponent* Owner) : TForm(Owner)
{
cmbGender->TextHint = "Select your gender";
edAge->Alignment = taCenter;
edAge->NumbersOnly = true;
edAge->MaxLength = 2;
btProcess->Enabled = false;
Memo1->CharCase = ecUpperCase;
lblGender->GlowSize = 5;
edInsAge->SetSelText("Age:");
edInsAge->Enabled = false;
}
void __fastcall TMainForm::btProcessClick(TObject *Sender)
{
Memo1->Lines->Clear();
if (SecondaryForm->ShowModal() == mrOk)
{
Memo1->Lines->Add("Your information has been processed.");
}
if (cmbGender->ItemIndex == 0)
{
Memo1->Lines->Add("Male");
}
else
{
Memo1->Lines->Add("Female");
}
Memo1->Lines->Add(edAge->Text);
}
void __fastcall TMainForm::edAgeChange(TObject *Sender)
{
edAge->Color = clHotLight;
btProcess->Enabled = true;
}
Uses
- Vcl.StdCtrls.TCustomButton.ModalResult ( fr | de | ja )
- Vcl.StdCtrls.TCustomComboBox.TextHint ( fr | de | ja )
- Vcl.StdCtrls.TCustomEdit.Alignment ( fr | de | ja )
- Vcl.StdCtrls.TCustomEdit.NumbersOnly ( fr | de | ja )
- Vcl.StdCtrls.TCustomEdit.TextHint ( fr | de | ja )
- Vcl.StdCtrls.TCustomEdit.MaxLength ( fr | de | ja )
- Vcl.StdCtrls.TCustomEdit.OnChange ( fr | de | ja )
- Vcl.StdCtrls.TCustomEdit.SetSelText ( fr | de | ja )
- Vcl.StdCtrls.TCustomLabel.GlowSize ( fr | de | ja )
- Vcl.StdCtrls.TCustomEdit.CharCase ( fr | de | ja )