TControlColor (C++)
Description
The following code changes the color of a shape control using the Color dialog box. The example displays the Color dialog box when the Button1 button is clicked, allowing you to select a color with the dialog box. When a color value is selected with the dialog box, it is assigned to the shape control.
Code
void __fastcall TForm1::Button1Click(TObject *Sender)
{
if (ColorDialog1->Execute())
Shape1->Brush->Color = ColorDialog1->Color;
}
Uses
- Vcl.Dialogs.TColorDialog.Execute ( fr | de | ja )
- Vcl.Dialogs.TColorDialog.Color ( fr | de | ja )
- Vcl.Controls.TControl.Color ( fr | de | ja )