Page 1 of 1

How to change value of Date-Time Picker

Posted: Thu Aug 02, 2007 7:34 am
by saurabh
I want to change the value of Date-Time Picker in my GUI automation.Like if current date is 8/2/2007 in Date-Time Picker i want to change it 4/1/2008 .I am trying with set_text() method as given code but its not working.I am using RanorexPro1.2 Version.

Application::Start("Alarms.exe");
form = Application::FindFormTitle("Alarms manager",Ranorex::SearchMatchMode::MatchExact,true,5000);
DateTimePicker* dtpCtrl = form->FindDateTimePicker("FromDTP");
String* DateValue = "4/1/2008 ";
dtpCtrl->set_Text(DateValue);

Please guide me and provide me proper code to do the same as soon as possible.
Thanks in Advance

How to change AM to PM in DateTime Picker

Posted: Thu Aug 02, 2007 12:53 pm
by saurabh
I have got the solution for above problem i am using code

dtpCtrl->SendKeys(sz->ToString());
dtpCtrl.SendKeys("11{RIGHT}01{RIGHT}2007");

Now if i want to set the Time like Date as given here so how can chnage AM to PM or vice versa.Above code working fine to change the time but not converting AM to PM
like 12:34:56 AM i want to set the value 10:44:55 PM

Please provide the code for the same

Posted: Thu Aug 02, 2007 7:09 pm
by webops
i want to set the value 10:44:55 PM
Did you try the following?

Code: Select all

dtpCtrl.SendKeys("22{RIGHT}44{RIGHT}55");
Jenö
Ranorex Team