Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Private Sub MonthCalendar1_DateSelected(ByVal sender As Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles MonthCalendar1.DateSelected
       If MonthCalendar1.SelectionStart > MonthCalendar1.TodayDate Then
           MsgBox("Date cannot be greater than today date")
           MonthCalendar1.Visible = True
           MonthCalendar1.Focus()
       Else
           MonthCalendar1.Visible = False
           per_dob.Text = MonthCalendar1.SelectionStart
       End If
   End Sub

   Private Sub MonthCalendar1_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles MonthCalendar1.Leave
       If MonthCalendar1.Visible = True Then
           MsgBox("Please close the calendar")
       End If
   End Sub

 

In the above code when i select the date i make the monthcalendar visible=false. Still i get the msg "Please close the calendar" when the date is selected. Could anyone please tell me where i have gone wrong. I get the msgbox displayed sometimes. How to avoid that.

Thanks & Regards,

zy_abc

Posted

Thks for the reply. It is a part of the form. When a button is clicked the monthcalendar is made is visible. If the date selected is correct i want to hide the monthcalendar. if the user opens the monthcalendar and tries to fill the other details i want to tell him to select the date and close the calendar.

 

How can it be acheived? Please help me out

Thanks & Regards,

zy_abc

Posted
But if we use DateTimePicker Time will get displayed. Further this calender is for Date of Birth. Is DateTimePicker suitable for this?

Thanks & Regards,

zy_abc

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...