[]
When end-users select the C1DateEdit control, then press the Enter or Tab to move to another control or select another control with the mouse, the current date is automatically entered into the C1DateEdit control.
To move to another control without the date being automatically entered, complete one of the following:
Create a new .NET project and place a C1DateEdit control and a C1TextBox control on your form.
To show end-users that a control has an empty value, in the C1DateEdit.NullText property, enter “”.
If you ran the program at this point and selected the C1DateEdit control with either the keyboard or mouse, then try to select the C1TextBox control, today’s date would automatically be entered into the C1DateEditr field and you would be unable to leave that field blank.
Notice that the cursor is in the C1TextBox but the current date remains in the C1DateEdit field.
Using the Properties window, change the C1DateEdit1.DateTimeInput property to False and change the C1DateEdit1.EmptyAsNull property to True.
Run the Program and click on the C1DateEdit control, then click on the C1TextBox.
Notice that even after switching to the C1TextBox, the C1DateEdit field remains empty.
Create a new .NET project and in the Solution Explorer add a reference to the C1Input control.
Add the following import statement to the code editor
To write code in Visual Basic
Imports C1.Win.C1Input
To write code in C#
using C1.Win.C1Input;
Add the C1DateEdit control and C1TextBox control to the Form_Load event.
To write code in Visual Basic
Dim X As New C1DateEdit
Controls.Add(X)
X.Location = New Point(50, 40)
Dim Y As New C1TextBox
Controls.Add(Y)
Y.Location = New Point(100, 80)
To write code in C#
C1DateEdit X = new C1DateEdit();
Controls.Add(X);
X.Location = new Point(50, 40);
C1TextBox Y = new C1TextBox();
Controls.Add(Y);
Y.Location = new Point(100, 80);
To show end-users that the control has an empty value, add the following code to the C1DateEdit entry.
To write code in Visual Basic
X.NullText = "{Empty Value}"
To write code in C#
X.NullText = "{Empty Value}";
If you ran the program at this point and selected the C1DateEdit control with either the keyboard or mouse, then try to select the C1TextBox control, today’s date would automatically be entered into the C1DateEdit field and you would be unable to leave that field blank.
To preserve the “Empty Value” in the C1DateEdit field even after switching to another control, add the following code to the C1DateEdit entry.
To write code in Visual Basic
X.DateTimeInput = False
X.EmptyAsNull = False
To write code in C#
X.DateTimeInput = False;
X.EmptyAsNull = False;
Run the Program and click on C1DateEdit control, then click on the C1TextBox.
Notice that even after switching to the C1TextBox, the C1DateEdit field remains empty.