I am trying to set a value in string for dateTimePicker1 but when i try the following code

dateTimePicker1->Value=System::Convert::ToDateTime("18/11/2010");

it doesn't change anything, the old value stays thesame.
How do i change the dateTimePicker to a string value?(for example : "18/11/2010")
Thanks in advanced.


PS: i am using c++, and a guy in the c++ forum told me to ask here, since you guys have more experiance in the .net field.

By default convert wants the DateTime in MM/DD/YYYY format. Do you have exception handling catching an error?

Secondly, add datatTimePicker1->Refresh(); after you set it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.