P
Peter Larsen [CPH]
Hi,
I'm trying to make some of the days (in a DateTimePicker) to appear bold,
but i can't figure out how to make this work.
I use .Net 3,5, Winforms on Visual Studio 2008.
I have found some code that looks very similar to the following:
IntPtr mHandle = SendMessage(new HandleRef(dateTimePicker1,
dateTimePicker1.Handle), DTM_GETMONTHCAL, IntPtr.Zero, IntPtr.Zero);
uint[] days = new uint[3];
days[1] = 0xff;
int result = SendMessage(new HandleRef(dateTimePicker1, mHandle),
MCM_SETDAYSTATE, 3, days);
The result is zero which indicates an unsuccessfully operation.
My SendMessage looks like this (the last sendmessage):
private static extern int SendMessage(HandleRef hWnd,
int Msg,
int wParam,
uint[] lParam);
I am not sure if this is right.
I have also tried MarshalAs and other stuff, but i'm not sure what is wrong
and where to fix it.
Any idea what to do ?
Thank you in advance.
Best Regards
Peter
I'm trying to make some of the days (in a DateTimePicker) to appear bold,
but i can't figure out how to make this work.
I use .Net 3,5, Winforms on Visual Studio 2008.
I have found some code that looks very similar to the following:
IntPtr mHandle = SendMessage(new HandleRef(dateTimePicker1,
dateTimePicker1.Handle), DTM_GETMONTHCAL, IntPtr.Zero, IntPtr.Zero);
uint[] days = new uint[3];
days[1] = 0xff;
int result = SendMessage(new HandleRef(dateTimePicker1, mHandle),
MCM_SETDAYSTATE, 3, days);
The result is zero which indicates an unsuccessfully operation.
My SendMessage looks like this (the last sendmessage):
private static extern int SendMessage(HandleRef hWnd,
int Msg,
int wParam,
uint[] lParam);
I am not sure if this is right.
I have also tried MarshalAs and other stuff, but i'm not sure what is wrong
and where to fix it.
Any idea what to do ?
Thank you in advance.
Best Regards
Peter