Extending Month Calendar

  • Thread starter Thread starter Ed Crowley
  • Start date Start date
E

Ed Crowley

How can I extend the MonthCalendar control to allow multiple date ranges to
be selected?

For example, I'd like to pass 01/01/2003 - 04/01/2003, 08/01/2003 -
14/01/2003 and have both ranges selected on the control.

Any help would be appreciated!
 
Ed,

You can not. What you really need to do is have a custom control which
will have two instances of the MonthCalendar controls, one for the beginning
of the date range, and one for the end. Then, you can have multiple
instances of this control to indicate multiple ranges.

Hope this helps.
 
Is it not possible to use the ownerdraw property to manually highlight
certain date ranges?

The calendar just needs to be read-only, getting the date ranges from a
database.

Nicholas Paldino said:
Ed,

You can not. What you really need to do is have a custom control which
will have two instances of the MonthCalendar controls, one for the beginning
of the date range, and one for the end. Then, you can have multiple
instances of this control to indicate multiple ranges.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Ed Crowley said:
How can I extend the MonthCalendar control to allow multiple date ranges to
be selected?

For example, I'd like to pass 01/01/2003 - 04/01/2003, 08/01/2003 -
14/01/2003 and have both ranges selected on the control.

Any help would be appreciated!
 
Ed,

It would be, but the amount of code you would have to do in order to do
this would be massive compared to just having two calendar controls. Also,
having two controls I think would be a better experience for the user, as it
is more clear that you have to set endpoints.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Ed Crowley said:
Is it not possible to use the ownerdraw property to manually highlight
certain date ranges?

The calendar just needs to be read-only, getting the date ranges from a
database.

message news:[email protected]...
Ed,

You can not. What you really need to do is have a custom control which
will have two instances of the MonthCalendar controls, one for the beginning
of the date range, and one for the end. Then, you can have multiple
instances of this control to indicate multiple ranges.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Ed Crowley said:
How can I extend the MonthCalendar control to allow multiple date
ranges
to
be selected?

For example, I'd like to pass 01/01/2003 - 04/01/2003, 08/01/2003 -
14/01/2003 and have both ranges selected on the control.

Any help would be appreciated!
 
Back
Top