Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

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
0
Anthony Matovu
Asked:
Anthony Matovu
1 Solution
 
CodeCruiserCommented:
>I am think of comparing current month with new month before I close.

That sounds reasonable to me.

What is the purpose of this code in DateChanged event.
0
 
Anthony MatovuBusiness Analyst, MTN UgandaAuthor Commented:
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
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now