Hi,
I am having some difficulty to set and get date on a control which seems to be of type SysDateTimePick32. Unfortunately when I create an object of type DateTimePicker using this control's handle, then I can't just set its text to the value I want. How do I do that. The control looks like the one in the following page at the top which is showing the value 6/16/70:
http://www.codeguru.com/cpp/controls/co ... php/c2229/
Thank you for your help.
Cheers,
Behdad.
DateTime Picker
You can read the datetime value of the control with the element value property as follows:
Unfortunately you cannot set the datetime value on the same way, but you can use the sendkey function (e.g. 11.01.2007):
Gabor Herget
Ranorex Team
Code: Select all
dtControl = form.FindClassName("SysDateTimePick32");
Element dtElement = dtControl.Element.FindChild(Role.DropList);
Console.WriteLine("Time-String: " + dtElement.Value);
Code: Select all
dtControl.Focus();
dtControl.SendKeys("11{RIGHT}01{RIGHT}2007");
Ranorex Team