By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,854 Members | 849 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,854 IT Pros & Developers. It's quick & easy.

datepicker help needed

P: n/a
TJS
found this code but get error message on handles
Compiler Error Message: BC30506: Handles clause requires a WithEvents
variable.

can anyone help resolve this ??
============================================
'Just drag calendar control onto the screen and turn it invisible.
'When you click a button, like "Get Date" or a picture of a calendar, turn
it visible:

Private Sub calTo_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles calTo.Click
Me.Calendar2.Visible = True
Me.Calendar2.BackColor = White
End Sub

'Then when you select a date, store it in a text box, check an option
button,
turn the calendar invisible and store the date in the session object for
'future use such as when you return to the page for a 2nd search.

Private Sub Calendar1_SelectionChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged

Me.txtDateFrom.Text = Me.Calendar1.SelectedDate.ToShortDateString
Me.optFrom.Checked = True
Me.Calendar1.Visible = False
Session("txtDateFrom") = txtDateFrom.Text.ToString

End Sub
============================================
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
How many calendars do you have on the page?

Your code suggests three:

calTo.Click
Calendar1.SelectionChanged
Me.Calendar2.Visible

Is it just a naming mixup?

Anyway, sometimes VS.NET gets mixed up with the adding and removing of big
controls. You might need to add one again, save all files, rename it to
match the name you want to use and save again.

Let us know?
"TJS" <no****@here.com> wrote in message
news:OK**************@TK2MSFTNGP12.phx.gbl...
found this code but get error message on handles
Compiler Error Message: BC30506: Handles clause requires a WithEvents
variable.

can anyone help resolve this ??
============================================
'Just drag calendar control onto the screen and turn it invisible.
'When you click a button, like "Get Date" or a picture of a calendar, turn
it visible:

Private Sub calTo_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles calTo.Click
Me.Calendar2.Visible = True
Me.Calendar2.BackColor = White
End Sub

'Then when you select a date, store it in a text box, check an option
button,
turn the calendar invisible and store the date in the session object for
'future use such as when you return to the page for a 2nd search.

Private Sub Calendar1_SelectionChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged

Me.txtDateFrom.Text = Me.Calendar1.SelectedDate.ToShortDateString
Me.optFrom.Checked = True
Me.Calendar1.Visible = False
Session("txtDateFrom") = txtDateFrom.Text.ToString

End Sub
============================================

Nov 17 '05 #2

P: n/a
TJS
hmmm..

not sure what the 3 references mean as I found this example.
I am just hopiong to find some help in getting the code sample cleaned up so
it can work. :)

Also I am not using VS.net I am using web matrix.
"Oliver" <DE*******************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
How many calendars do you have on the page?

Your code suggests three:

calTo.Click
Calendar1.SelectionChanged
Me.Calendar2.Visible

Is it just a naming mixup?

Anyway, sometimes VS.NET gets mixed up with the adding and removing of big
controls. You might need to add one again, save all files, rename it to
match the name you want to use and save again.

Let us know?
"TJS" <no****@here.com> wrote in message
news:OK**************@TK2MSFTNGP12.phx.gbl...
found this code but get error message on handles
Compiler Error Message: BC30506: Handles clause requires a WithEvents
variable.

can anyone help resolve this ??
============================================
'Just drag calendar control onto the screen and turn it invisible.
'When you click a button, like "Get Date" or a picture of a calendar, turn it visible:

Private Sub calTo_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles calTo.Click
Me.Calendar2.Visible = True
Me.Calendar2.BackColor = White
End Sub

'Then when you select a date, store it in a text box, check an option
button,
turn the calendar invisible and store the date in the session object for
'future use such as when you return to the page for a 2nd search.

Private Sub Calendar1_SelectionChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged

Me.txtDateFrom.Text = Me.Calendar1.SelectedDate.ToShortDateString
Me.optFrom.Checked = True
Me.Calendar1.Visible = False
Session("txtDateFrom") = txtDateFrom.Text.ToString

End Sub
============================================


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.