Link to home
Start Free TrialLog in
Avatar of foobarr
foobarrFlag for Canada

asked on

date time picker null value

Hi

I am having trouble using the DateTimePicker control.  

I basically want to print out each time a user choses a date.  So I use the ValueChanged event.  

However everytime I run my program, the DateTimePicker starts with a null value.  I found this out by just having a messagebox display the dateTimePickerControl.value.

I have the Control on a panel that is not initially visible, so only when I change to that panel is where the right date gets displayed.

Since it is a null value any other methods that I run because of a date change crash my program.  

I was thinking of creating the control dynamically, but I was wondering if there was another way?
Avatar of foobarr
foobarr
Flag of Canada image

ASKER

Well I change the messagebox to print out the Value of the control and it worked fine...but it only displays the date and time a generic way

I need it formatted to yyyy-MM-dd cuz i'm using mysql so I need to use the control.text which gives me a null value when loading hte program up
SOLUTION
Avatar of heintalus
heintalus

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial