Solved

Date Time Picker uncheck problem

Posted on 2004-04-21
8
1,423 Views
Last Modified: 2008-02-01
Hi,

I'm using a Data Time Picker control (System.Windows.Forms.DataTimePicker) in my application.

I set it's ShowCheckBox Property to True. And set it Checked Property to False, and Set the default value to 01/01/1978

Then when i run the application, the Data Time Picker control is always Checked! When i back to the Form Design, the Checked Property stands as False. Why??! This simply confusing me.. Did i miss out something?

So, the question is:

How to set the Data Time Picker Control value and make it stays UnChecked?

In vb6 time, i can use DTPicker1.Value = Null but this is Not working in .net.

Any idea? thks
0
Comment
Question by:Ryan Chong
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 8

Expert Comment

by:bramsquad
ID: 10879999
hmmm i dont know if this will work, but in the form_load section, just try this

dtpicker1.checked = false
0
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 10880131
just a suggestion

try setting the showcheckbox property after the setting the default value

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DateTimePicker1.Value = Now
        DateTimePicker1.ShowCheckBox = True
    End Sub
0
 
LVL 9

Expert Comment

by:malharone
ID: 10883725
this is a bug in win xp !!
I've had the same problem .. after slamming my head w/ wall a few times, i came across an article from MS website, which basically said this is a bug in win xp common controls. this was 3-4 months ago. i think they've fixed it by now. i can't find the article !
0
 
LVL 49

Author Comment

by:Ryan Chong
ID: 10885842
bramsquad
That's doesn't help, tried that before but didn't works..

RonaldBiemans
This is Not what i want, i also need to make sure the DTPicker's checkbox is UnChecked..

>>this is a bug in win xp !!
I'm using Win2k Adv Server, and my framework version is 1.0.3705, using M$ Development Environment 2002, version 7.0.9466.
It will be really helpful if you can provide me something here..

thks
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 50 total points
ID: 10886434
I've search the internet and there are several mentions of this problem but they all suggest this solution

dtp.value = now
dtp.checked = true
dtp.checked = false
0
 

Expert Comment

by:fatihdurgut
ID: 10888960
i had the same problem,it's about datetime control.
It is inconsistent :)
so i write like this
dtp.checked=true
dtp.checked=false

funy but it's working :)
0
 
LVL 49

Author Comment

by:Ryan Chong
ID: 10889676
What a bug from M$! only their programmers know why come like that..

anyway, thks guys for the comments, i resolved my problem ;-) cheers
0
 
LVL 9

Expert Comment

by:malharone
ID: 10890675
actually .. i had dome same (i.e. checked=true/false) .. but it'll still be inconsistent .. i can email you a screenshot as a proof that I had taken and email m$.

- malhar
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Text in tooltip bound field bridview 3 30
reports, calling from code. 3 31
System32Int Error 8 44
Copy/Clone an object. 9 18
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now