|
-
Jan 31st, 2005, 11:03 AM
#1
Thread Starter
Frenzied Member
DTPicker checkbox event
I'm using a DTPicker in my project. I want to set its value to today when the user changes the DTPicker's checkbox from unchecked to checked. I'm not binding it to any data - its just standalone.
I don't have a problem with setting the date to today, but I can't find a way of telling when the user has changed the checkbox to checked. The _Click event is no good because this fires when the dd/mm/yy section is clicked as well.
Can anyone help?
Last edited by trisuglow; Jan 31st, 2005 at 11:45 AM.
This world is not my home. I'm just passing through.
-
Jan 31st, 2005, 11:20 AM
#2
Re: DTPicker checkbox event
When the CheckBox is unchecked the Value property becomes Null, so the Click event can still be used.
VB Code:
Private Sub DTPicker1_Click()
If IsNull(DTPicker1.Value) Then
DTPicker1.Value = Now
DTPicker1.Value = Null
End If
End Sub
-
Jan 31st, 2005, 11:24 AM
#3
Thread Starter
Frenzied Member
Re: DTPicker checkbox event
Thanks, but this doesn't work for me. I don't want the date to be set to today when the user unchecks the box, only when they check it.
Any further thoughts?
This world is not my home. I'm just passing through.
-
Jan 31st, 2005, 11:39 AM
#4
Re: DTPicker checkbox event
Put the above code in the MouseDown event of the DatePicker.
-
Jan 31st, 2005, 12:11 PM
#5
Thread Starter
Frenzied Member
Re: DTPicker checkbox event
Good solution Bruce. Thanks.
This world is not my home. I'm just passing through.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|