This is going to require a bit of pinvoke to send the messages to get the calendar to switch the view. Implement the DateTimePicker's DropDown event handler like this:
private void dateTimePicker1_DropDown(object sender, EventArgs e) {
IntPtr cal = SendMessage(dateTimePicker1.Handle, DTM_GETMONTHCAL, IntPtr.Zero, IntPtr.Zero);
SendMessage(cal, MCM_SETCURRENTVIEW, IntPtr.Zero, (IntPtr)1);
}
// pinvoke:
private const int DTM_GETMONTHCAL = 0x1000 + 8;
private const int MCM_SETCURRENTVIEW = 0x1000 + 32;
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp);
The view switching is animated, it is going to be visible to the user. This won't work for Windows versions prior to Vista. Use an online translator if necessary to translate this C# code to VB.NET
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…