I am trying to set a value in string for dateTimePicker1 but when i try 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.

Recommended Answers

All 2 Replies

I tried a few things, but I didn't come up with a solution. I don't use this date format on my machine so I couldn't test it fully anyway. You could always use the dateTimePicker1->Value = DateTime(year, month, day); overload (where those are ints), but I'm not sure that will get you what you want.

Failing all that, and if you don't get any more replies over here, it couldn't hurt to ask in C# as there are folks there that deal with this .NET stuff and might have the answer at their fingertips.

Ok, ill ask in the c# terain and see what they will say.

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.