Ask a Question

Set value into DateTimePicker with wDate doesn't work

tuanvinh1008
Contributor

Set value into DateTimePicker with wDate doesn't work

Hi all,

In my application, there are some DateTimePicker controls and I tried to use .wDate for setting value into that control but it doesn't work, nothing to fill this control. Do we have any other way to handle it? Here is my code

 

function Test1()
{
//Sets the date '14/01/2020' in the 'dateTimePicker' date/time picker.
Aliases.BPXXXX.BCValueDate.dateTimePicker.wDate = "14/01/2020";
}

 

thanks,

Vinh

5 REPLIES 5
Marsha_R
Community Hero

Is wDate a string format object or a date format object?  Right now you are giving it a string value.


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

it is string format. my value is "2020-14-01"

Hi @tuanvinh1008 - 

 

Have you tried using a keys or a SetText? You do not have to use a date specific method in this case. 

 

Emma

@ebarbera 

Hi, Don't have SetText method in this control.

Try recording a short test where you pick the date and see what code TestComplete gives you for doing this.  Then try running that test again to make sure it works.


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
cancel
Showing results for 
Search instead for 
Did you mean: