Working With DateTimePicker Controls in Desktop Windows Applications

Applies to TestComplete 15.40, last modified on March 25, 2022

TestComplete offers a set of functions to work with standard Win32 controls from your tests, including the DateTimePicker control. To work with Win32 DateTimePicker controls it uses the Win32DateTimePicker object. This object is automatically associated with DateTimePicker controls whose class names are listed in the project’s Object Mapping options. If your tested application uses a DateTimePicker control that is inherited from a standard DateTimePicker, you can associate it with the Win32DateTimePicker object by adding its class name to the Object Mapping list. For more information, see Default Project Properties - Object Mapping Options.

Using properties and methods of the Win32DateTimePicker object, you can work with the DateTimePicker control. For instance, you can use these properties to set and get the date or time selected in the DateTimePicker control. The topics of this section describe how to work with the DateTimePicker control.

Note: Though the following topics deal with scripts, you can use the same approaches while testing an application from your keyword tests. For more information, see Keyword Tests Basic Operations.

In This Section

Getting DateTimePicker Format in Desktop Windows Applications

Describes how to determine whether the DateTimePicker control is used to select a date or time.

Obtaining DateTimePicker Date and Time in Desktop Windows Applications

Describes how to obtain the date or time selected in the DateTimePicker control.

Setting DateTimePicker Date in Desktop Windows Applications

Describes how to specify the date the DateTimePicker control displays.

Setting DateTimePicker Time in Desktop Windows Applications

Describes how to specify the time the DateTimePicker control displays.

Getting Minimum and Maximum Allowed DateTimePicker Dates in Desktop Windows Applications

Describes how to obtain the maximum and minimum dates the DateTimePicker control can show.

Working With DateTimePicker Controls' Check Boxes in Desktop Windows Applications

Describes how to determine whether the DateTimePicker control’s check box is visible or hidden and how to clear or check it.

Related Topics of Interest

Working With MonthCalendar Controls in Desktop Windows Applications

Explains how you can simulate actions over MonthCalendar controls with TestComplete.

Simulating User Actions

Explains the approaches used for simulating user actions over applications’ controls.

See Also

Win32 DateTimePicker Support
Object-Specific Tasks
Supported Controls
Default Project Properties - Object Mapping Options

Highlight search results