Solved

i close monthcalender control when i chose to navigate the month

Posted on 2014-04-15
2
287 Views
Last Modified: 2014-04-25
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
Comment
Question by:Anthony Matovu
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 40006312
>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
 
LVL 1

Author Comment

by:Anthony Matovu
ID: 40006653
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now