
Signature
"Who will guard the guards?"
I totally get the example code, but haven't dealt with event handlers before
so the following declaration/usage code leaves me cold. Can you help?
Visual Basic (Declaration)
Public Event CloseUp As EventHandler
Visual Basic (Usage)
Dim instance As DateTimePicker
Dim handler As EventHandler
AddHandler instance.CloseUp, handler
FYI, I tried declaring the public event but got an error...is it
> Check htis link for more information
>
[quoted text clipped - 16 lines]
> >
> > Thanks
Shauna Kelly - 17 Nov 2006 22:43 GMT
Hi jille
It's not as hard as it looks. In the code of your form, at the top left of
the code window, there's a drop down box that lists all the controls on your
form. Choose your date picker in that list.
Now, in the drop down box at the top right, choose CloseUp.
Word will insert the appropriate code. If your datepicker is named, say,
dtpStart then the code will look like
Private Sub dtpStart_CloseUp()
End Sub
You can put whatever you like between the two lines of code Word provides.
For example:
Private Sub dtpStart_CloseUp()
MsgBox "You chose " & Me.dtpStart.Value
End Sub
Hope this helps.
Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
>I totally get the example code, but haven't dealt with event handlers
>before
[quoted text clipped - 35 lines]
>> >
>> > Thanks