Link to home
Start Free TrialLog in
Avatar of Anthony Matovu
Anthony MatovuFlag for Uganda

asked on

i close monthcalender control when i chose to navigate the month

I have this code, but when I choose to navigate the month it set the .SelectionRange.Start to the date of that new month and therefore closes. I want it stay until I have finished the navigation through the months. I am think of comparing current month with new month before I close. Is there a better and direct way.

Thank you


Private Sub MonthCalendar1_DateChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles MonthCalendar1.DateChanged
        If (MonthCalendar1.SelectionRange.Start & "").Trim.Length > 0 Then
            adate.Text = MonthCalendar1.SelectionRange.Start
            MonthCalendar1.Visible = False
        Else
            adate.Text = ""
        End If
    End Sub
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Anthony Matovu

ASKER

When I position the cursor in a textbox that is supposed to received the calendar value, the monthcalender control is visible. I select the date and it should close.  It fails to give a chance to navigate the months before I chose the date.

thank you

Anthony