How to change value of Date-Time Picker

Class library usage, coding and language questions.
saurabh
Posts: 20
Joined: Fri Jul 20, 2007 1:11 pm
Location: India
Contact:

How to change value of Date-Time Picker

Post by saurabh » Thu Aug 02, 2007 7:34 am

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

saurabh
Posts: 20
Joined: Fri Jul 20, 2007 1:11 pm
Location: India
Contact:

How to change AM to PM in DateTime Picker

Post by saurabh » Thu Aug 02, 2007 12:53 pm

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
Regards,
Saurabh Shrivastava
GE Global Research
Bangalore India

admin
Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by admin » Thu Aug 02, 2007 7:09 pm

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