Calendar control in compact framework 1.1

G

Guest

hi all,


Environment :
Visual studio 2003
compact Framework 1.1 :
using winforms with VB.NET :
Emulator's OS : windows CE.NET

all i want to do is use the regular calendar ( date time) controls in my
winforms compact framework develpment. i can see that the datetime control is
selected in my list of controls but i still do that see it in my IDE's
toolbar to use ? does this mean there is no datetime control at all to be
used in compact framework 1.1 with my winforms?

thanks for your answer, quick answer is highly appreciated.

thanks
Sameer
 
G

Guest

hmm, that is strange. So there is absolutely no way other then thrid party
control. How has your experience been with this Smart Device Framework v1.4 ?
i am right at the final moment of a deadline and this news is definelty not
good. got two questions for you

1.while doing the develpment i used text boxes just to get it gong, now
when i am replacing it with these controls , hope it is going to be very easy
transition. Please state your experience.

2. Also how does the deployment work, i am hoping that i will jsut have to
include this in my compact framework project and while deployment just copy
this control to barcode scanner with the appilcation it should just work,
Please let me know .

thanks
 
P

Peter Foot [MVP]

That's correct, there is however a DateTimePicker and MonthCalendar control
in .NETCF v2.0. Since I wrote many of the Smart Device Framework features my
experiences are rather biased :) You'll find it invaluable, not just for
the DateTimePicker but lots of other classes and controls which are missing
in .NETCF v1.0 which you'll be used to using on the desktop. It's packaged
as a .cab file which you install along with your application which will
install all the SDF .dlls.

Peter
 
G

Guest

Peter, i am using the datetimepicker controls from opennetcf and seems i am
at a dead end and here is the problem.

the only way to indicate that no value has been selected in the
datetimepicker is to set the showcheckbox property to true and make use of
it. but the strange part is that when i am using this on a panel ( and i am
using panels all over the form) no matter how many times i set the
showcheckbox property =true , it does not show the checkbox in the
datetimepicker control. Now just that the same behavior applies to the
showupdown property as well i.e no matter how many tmies i set it when it is
palced on a panel control, it does not show it. If it is placed on a form it
is visible.

do u ever come across this problem , if so how did you handle this?

thanks
 
G

Guest

Also btw do you suggest any other third party control which might provide a
better datetimepicker control then this? thanks
 
G

Guest

Sameer,

I ran into what's probably the same problem. It seems to occur if you set
the the property after the DateTimePicker has already been drawn. It doesn't
redraw itself with the checkbox.

To fix it, I added the following code to the end of SetDTPStyle method in
DateTimePicker.cs:

if (this.Parent != null)
UpdateControlStyle();

And this new method:

private void UpdateControlStyle()
{
IntPtr hwnd = this.ChildHandle;
int style = Win32Window.GetWindowLong(hwnd, (int)GWL.STYLE);
style &= ~0x000000FF;
style |= this.m_style;
Win32Window.SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP.HIDEWINDOW
| SWP.NOMOVE | SWP.NOZORDER | SWP.NOSIZE | SWP.NOACTIVATE |
SWP.FRAMECHANGED);
Win32Window.SetWindowLong(hwnd, (int)GWL.STYLE, style);
Win32Window.SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP.SHOWWINDOW
| SWP.NOMOVE | SWP.NOZORDER | SWP.NOSIZE | SWP.NOACTIVATE |
SWP.FRAMECHANGED);
}

(You could probably use ShowWindow instead of SetWindowPos, but it's not
defined in Win32Window.)
 
G

Guest

does any body suggest any other third party control which might provide a
better datetimepicker control then this? thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top