Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTimePicker - problem setting to unchecked

Status
Not open for further replies.

Marg

Programmer
Nov 9, 2001
3
CA
I'm trying to use the DateTimePicker control for my
application. The issue I'm having is in trying to set the .Checked property of this DatePicker control to false. I want this control to be UN-checked by default (indicating no value selected) with today's date displayed. However, it doesn't want to stay unchecked.
It is as if setting a value for the value property automatically sets the .Checked to
true.

I did some research on the web, and found someone else had posted the same issue. Scott Berry from Microsoft had the following reply:


This is a bug (the same bug that Joe (JFuentes) pointed out earlier). A workaround is to set Checked =3D false last. To later set the date, toggle the Checked property:

dateExpiration.Value =3D
dateExpiration.Value.AddDays(1);
dateExpiration.Checked ^=3D true;
dateExpiration.Checked ^=3D true;

-Scott


My problem now is applying the above workaround to VB.Net. ie. What is “3D false”?. Setting the checked property simply to false last in VB.NET is not working for me.

Any help with this would be greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top