| View previous topic :: View next topic |
| Author |
Message |
behdad
Joined: 22 Nov 2006 Posts: 16 Location: Australia
|
Posted: Thu Jan 11, 2007 7:13 am Post subject: DateTime Picker |
|
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/controls/dateselectioncontrolsetc /article.php/c2229/
Thank you for your help.
Cheers,
Behdad. |
|
| Back to top |
|
 |
admin Site Admin
Joined: 05 Jul 2006 Posts: 351
|
Posted: Thu Jan 11, 2007 10:00 pm Post subject: |
|
You can read the datetime value of the control with the element value property as follows:
Code: click into code to enlarge
dtControl = form.FindClassName("SysDateTimePick32");
Element dtElement = dtControl.Element.FindChild(Role.DropList);
Console.WriteLine("Time-String: " + dtElement.Value);
Unfortunately you cannot set the datetime value on the same way, but you can use the sendkey function (e.g. 11.01.2007):
Code: click into code to enlarge
dtControl.Focus();
dtControl.SendKeys("11{RIGHT}01{RIGHT}2007");
Gabor Herget
Ranorex Team |
|
| Back to top |
|
 |
behdad
Joined: 22 Nov 2006 Posts: 16 Location: Australia
|
Posted: Fri Jan 12, 2007 1:35 am Post subject: |
|
Hi Gabor,
Thank you. I was more interested in setting and it did work.
Cheers,
Behdad. |
|
| Back to top |
|
 |
|