自己做个控件,放上月历控件和panel什么的自己组合绘画把
c#自带的月历控件的源代码里说明了
/// <include file='doc\MonthCalendar.uex' path='docs/doc[@for="MonthCalendar"]/*' />
/// <devdoc>
/// This control is an encapsulateion of the Windows month calendar control.
/// A month calendar control implements a calendar-like user interface, that
/// provides the user with a very intuitive and recognizable method of entering
/// or selecting a date.
/// Users can also select which days bold. The most efficient way to add the
看这段
/// <include file='doc\MonthCalendar.uex' path='docs/doc[@for="MonthCalendar.CreateParams"]/*' />
/// <devdoc>
/// This is called when creating a window. Inheriting classes can ovveride
/// this to add extra functionality, but should not forget to first call
/// base.getCreateParams() to make sure the control continues to work
/// correctly.
/// </devdoc>
protected override CreateParams CreateParams {
[SecurityPermission(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)]
get {
CreateParams cp = base.CreateParams;
cp.ClassName = NativeMethods.WC_MONTHCAL;
cp.Style |= NativeMethods.MCS_MULTISELECT | NativeMethods.MCS_DAYSTATE;
if (!showToday) cp.Style |= NativeMethods.MCS_NOTODAY;
if (!showTodayCircle) cp.Style |= NativeMethods.MCS_NOTODAYCIRCLE; if (showWeekNumbers) cp.Style |= NativeMethods.MCS_WEEKNUMBERS;
if (RightToLeft == RightToLeft.Yes && RightToLeftLayout == true) {
//We want to turn on mirroring for Form explicitly.
cp.ExStyle |= NativeMethods.WS_EX_LAYOUTRTL;
//Don't need these styles when mirroring is turned on.
cp.ExStyle &= ~(NativeMethods.WS_EX_RTLREADING | NativeMethods.WS_EX_RIGHT | NativeMethods.WS_EX_LEFTSCROLLBAR);
}