MonthCalendar: Get visible range

Posted on 2007-08-08
Last Modified: 2008-01-09
I have a MonthCalendar setup that displays 2 months across and 3 months down for a total of 6 visible months. Does anyone know a way in vb.Net to programmatically determine the months that are currently visible? Thanks.
Question by:rbichon
    LVL 46

    Accepted Solution

    Hi rbichon,

    You can use GetDisplayRange....

            Dim StartDate As Date = Me.MonthCalendar1.GetDisplayRange(True).Start
            Dim endDate As Date = Me.MonthCalendar1.GetDisplayRange(True).End
            MsgBox("MonthCalendar displaying dates between " & StartDate & " and " & endDate)


    LVL 1

    Author Comment

    Is there an event that fires when the display range changes?
    LVL 46

    Expert Comment

    by:Wayne Taylor (webtubbs)
    No, there's not, but you could capture the DateChanged event, which fires when the selected date has changed, which also happens when the visible range is changed.
    LVL 1

    Author Comment

    It doesn't always happen. Only when the current date is no longer in the visible range. I will just use the events when the control is clicked or the mousewheel is detected.

    Do you know if there is an easy way to remove the bolded dates?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    758 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

    11 Experts available now in Live!

    Get 1:1 Help Now