Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTPicker - Setting time with un-checked checkbox!

Status
Not open for further replies.

AGP

Programmer
Sep 11, 2001
97
0
0
GB
I am using a DTPicker in my VB6 application. When my form loads I want it to display a DTPicker to display the time and including a checkbox so that the user has the option to select a time or not. What I can't seem to do is un-check the check box at run time rather than having to manually un-check it by clicking on it. I know I could create a separate checkbox and use it to toggle the DTPickers enabled state, but surely there must be a way to change the state of the checkbox provided in the DTPicker! Any suggestions?
many thanks.
 
Try this

Private Sub Form_Load()
DTPicker1.Value = Null
End Sub

Hope this works
 
Try this

Private Sub Form_Load()
DTPicker1.Value = Null
End Sub

Hope this works

make the property

format = 2
checkbox value = 1
 
'sets date to today before deselecting box
DTPicker1.Value = Now
'deselects checkbox
DTPicker1.Value = ""

This will give you an empty checkbox and the date shown will revert to today and show in grey
 
Just what I wanted to do, thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top