Code Block
:
public
thisnewEventHandler
privatebool
privateTextBox
privateButton
privateMonthCalendar
ToolStripDropDown
voidobjectEventArgs
thistrue
thisnewMonthCalendar
thisnewDateRangeEventHandler
popup = ();
Padding
Padding
ToolStripControlHostnewToolStripControlHostthis
Padding
Padding
thisthis
this
thisnewTextBox
this
this
thisthis
this
thisDateTime
thisthis
thisnewButton
thisthis
this
this
this
thisnewPaintEventHandler
thisnewEventHandler
thisthis
(Continued)
Code Block
calendar_DateSelected( sender, e)
this
thistrue
this
voidobjectPaintEventArgs
ControlPaint
this
ButtonState
privatevoidobjectEventArgs
if
Point
thisthis
this
this
thisthis
else
this
It's better to use a ToolStripDropDownHost to host theMonthCalendar,and add the ToolStripDropDownHost to a ToolStripDropDown control. The following sample demonstrates how to do this.
Code Block
:
public
thisnewEventHandler
privatebool
privateTextBox
privateButton
privateMonthCalendar
ToolStripDropDown
voidobjectEventArgs
thistrue
thisnewMonthCalendar
thisnewDateRangeEventHandler
popup = ();
Padding
Padding
ToolStripControlHostnewToolStripControlHostthis
Padding
Padding
thisthis
this
thisnewTextBox
this
this
thisthis
this
thisDateTime
thisthis
thisnewButton
thisthis
this
this
this
thisnewPaintEventHandler
thisnewEventHandler
thisthis
(Continued)
Code Block
calendar_DateSelected( sender, e)
this
thistrue
this
voidobjectPaintEventArgs
ControlPaint
this
ButtonState
privatevoidobjectEventArgs
if
Point
thisthis
this
this
thisthis
else
this
Hi Zhi-Xin Ye - MSFT,
Many Thanks for that reply. I have gone through it butI was just wondering is the program still using calendar in the same form. I have to customize the user control and drag and drop it to other pages.
I am also unsure about the toolstrip drop down and how to use that control..