hi guys,
i'm new to vb programming so please bare with me (lol),
can someone help me,
i want to display the DTPicker as a blank before user selects any date
from it.
thanx in advance,
keep smiling
:):);)
Printable View
hi guys,
i'm new to vb programming so please bare with me (lol),
can someone help me,
i want to display the DTPicker as a blank before user selects any date
from it.
thanx in advance,
keep smiling
:):);)
Welcome to the forums. :wave:
I'm not sure I understand what you mean by "as a blank". Do you mean with no date highlighted?
If you set the Checkbox property of the DTP it will then be a null date value and appear greyed out but the dropdown arrow and checkbox will function still.
vb Code:
Option Explicit Private Sub Form_Load() DTPicker1.CheckBox = True DTPicker1.Value = vbNullString End Sub
To have a blank date
Set the Format property to Custom
Set the CustomFormat property to a single space
Set the CustomFormat property when a user selects a date.
The above is minimal, you will need to also handle keyboard activity and more...Code:Private Sub Form_Load()
DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = " "
End Sub
Private Sub DTPicker1_CloseUp()
If DTPicker1.CustomFormat = " " Then
DTPicker1.CustomFormat = "dd-MMM-yyyy"
End If
End Sub
thanx bro,
keep ur posts comming
thanx keep smiling
:):);)