From Clomosy Docs
function AddNewProDateEdit(AComponent: TCLComponent; xName: string): TClProDateEdit;
AComponent : Specifies the parent of the object to be defined.
xName : The name of the defined TClProDateEdit object must be written.
Represents a single-line editable text box containing a date.
When you click or tap the TClProDateEdit control, it displays a date picker that allows you to select a date.
| Feature | Use of | Definition |
|---|---|---|
| TClProDateEdit | DateEdit1 : TClProDateEdit; | A variable belonging to the TClProDateEdit class is created. |
| AddNewProDateEdit | DateEdit1 = Form1.AddNewProDateEdit(Form1,'DateEdit1'); | A new TClProDateEdit is added to the form. |
| DateStr | DateEdit1.DateStr | Returns the selected date value. |
In addition to the features of a standard date edit, TClProDateEdit offers new and advanced features, which we will explain in detail below.
clProSettings Properties
To learn the purpose and usage of the clProSettings properties, please refer to the page.
Example
Var
Form1:TclForm;
DateEdit1: TClProDateEdit;
Button1 : TclButton;
void ProDateEditShowStr;
{
ShowMessage(DateEdit1.DateStr);
}
void SetTestDate;
{
DateEdit1 = Form1.AddNewProDateEdit(Form1,'DateEdit1');
DateEdit1.Align = alCenter;
DateEdit1.Width = 150;
DateEdit1.Height = 50;
DateEdit1.clProSettings.BorderColor = clAlphaColor.clHexToColor('#323d8c');
DateEdit1.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#a6ade3');
DateEdit1.clProSettings.RoundHeight = 10;
DateEdit1.clProSettings.RoundWidth = 10;
DateEdit1.clProSettings.BorderWidth = 2;
DateEdit1.clProSettings.FontHorzAlign = palCenter;
DateEdit1.clProSettings.TextSettings.Font.Style = [fsBold];
DateEdit1.clProSettings.FontSize = 20;
DateEdit1.clProSettings.IsFill = True;
DateEdit1.clProSettings.IsRound = True;
DateEdit1.SetclProSettings(DateEdit1.clProSettings);
}
{
Form1 = TclForm.Create(Self);
SetTestDate;
Button1= Form1.AddNewButton(Form1,'Button1','Click');
Button1.TextSettings.Font.Size=50;
Button1.Align = alBottom;
Button1.Margins.Left = 60;
Button1.Margins.Right = 60;
Button1.Margins.Bottom = 50;
Button1.Height = 50;
Button1.Width = 100;
Form1.AddNewEvent(Button1,tbeOnClick,'ProDateEditShowStr');
Form1.Run;
}
Output: