SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

[newbie] In Calendar, how to select more than a week range? How to get selected range?

Last post 06-19-2017 9:06 PM by sbridewell. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-05-2017 12:29 PM

    [newbie] In Calendar, how to select more than a week range? How to get selected range?

    Hello,

    I have only basic knowledge of SharpDevelop, and need to simply display a calendar so that I can select a multi-day range and turn into a list like this:

    Tue 4 July
    Wed 5 July
    etc.

    After installing SharpDevelop 4.4.2*, I notice that by default, the calendar only supports selecting up to one week: How to remove this limit? And how to turn the selected range into a list of days?

    Thank you.

    apparently, release 5 doesn't support VB

  • 06-19-2017 9:06 PM In reply to

    Re: [newbie] In Calendar, how to select more than a week range? How to get selected range?

    The control you are using looks like the System.Windows.Forms.MonthCalendar control, which is supplied by Microsoft as part of the .net framework, so any questions about it really ought to be directed to Microsoft. I've tried it using both SharpDevelop 5.2 and Visual Studio 2015 community edition, and in neither can I select more than 7 days, so this is a restriction imposed by the control rather than by the IDE.

    I can answer your second question (albeit in C#, sorry). If your MonthCalendar instance is called monthCalendar1 then this should do the trick:

            public Collection<DateTime> SelectedDays
            {
                get 
                {
                    SelectionRange range = monthCalendar1.SelectionRange;
                    Collection<DateTime> returnValue = new Collection<DateTime>();
                    for (DateTime d = range.Start; d <= range.End; d = d.AddDays(1))
                    {
                        returnValue.Add(d);
                    }
                    
                    return returnValue;
                }
            }

    Hope this helps.

    Simon

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.