LabeledEdit (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example demostrates how to configure a TLabeledEdit at run time. A TLabeledEdit is assumed to be placed on the form.

Code

__fastcall TMainForm::TMainForm(TComponent* Owner)
	: TForm(Owner)
{
	TBoundLabel* editLbl;

	/* Retrieve the label associated with the edit control. */
	editLbl = edtName->EditLabel;

	/* Configure the label. */
	editLbl->Caption = "Specify the name:";
	editLbl->Font->Color = clBlue;

	/* Set the label position and spacing relative to
	   the edit control. */
	edtName->LabelPosition = lpAbove;
	edtName->LabelSpacing = 2;
}

Uses

Personal tools
Assistance