General Windows Control Properties, Methods and Events

A base set of properties, methods, and events apply to controls created through interrogation of Windows applications (OpenSpan.Adapters.Controls.Control). Definitions of these properties, methods, and events are provided in the table below. Additional properties, methods, and events are exposed based on the target type. For example, for a RichTextBox control, the AppendText method is available (among other control-specific methods.) See the following topics for more information on OpenSpan.Adapters.Windows.Targets:

TabbedReparentContainer

Grid Controls

ListBox/ComboBox Controls

ListView

Radio Button

TreeView

Properties

 

Property

Description

Bottom

Gets the distance, in pixels, between the bottom edge of the control and the top edge of its container's client area.

BoundsRectangle

Gets or sets the size and location of the control including its non-client elements, in pixels, relative to the parent control. Type: Rectangle

ClientRectangle

Gets the rectangle that represents the client area of the control.

Enabled

Gets or sets a value (Boolean) indicating whether the control can respond to user interaction.

Extender

 

FullName

Gets the fully qualified name of the control (e.g., CRM.txtName). Type String.

Focused

Gets a value (Boolean) indicating whether the control has input focus.

Height

Gets or sets the height of the control. Return type: Int32

IsCreated

Indicates whether the control has been created (matched). Return type: Boolean

IsDisposed

Property included for as part of system references, however it is not used in automations.

Key

Gets or sets the unique Key value for the control. This property is used for applications that contain cloned targets. See the Cloned Controls topic for more information. Return type: String

Left

Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area. Type: Int32

Location

Gets or sets the location that represents the top left area of the control. Type: Point

MaskEventText

See the Configure Monitored Events topic for details on this property.

MaskEventValue

See the Configure Monitored Events topic for details on this property.

Name

Gets or sets the name assigned to the control. Type: String.

NextKey

Sets the key value that will be assigned to the next clone created. This property is used for applications that contain cloned targets. See the Cloned Controls topic for more information. Type: String

Right

Gets the distance, in pixels, between the right edge of the control and the left edge of its container's client area. Type: Int32

ScreenRectangle

Gets the rectangle that represents the screen area of the control.

Size

Gets or sets the size of the control. Type: Size

TargetName

Gets the name that was assigned to the target

TargetType

Gets assembly and type for the control (e.g., OpenSpan.Adapters.Windows.Targets.TextBox). Type: TargetType

Text

Gets or sets the text associated with this control. Note: This property will not return anything for Common List Controls as these controls do not have a Text property. Type: String

This

A reference to the control object. Type: Object

Timeout

Specifies the timeout for the Created event in milliseconds. Type: Int32

Top

Gets the visibility of the control. Type: Boolean

UniqueID

Gets the identity of the control, for example, WindowsAdapter-8CC89A3AD46E95C\RichTextBox-8CC89A3D72635FC.

UnmatchOnHidden

Sets the matching status of application controls when they are hidden at runtime.

• Set this property to True to have the control become unmatched when hidden (it will be automatically rematched when the target is shown).

• Set to False to have the control remain matched when hidden.

Note that if this property is set to True and the control is hidden, you cannot use the Rematch or RematchChildren methods to rematch the hidden target. See the Working with Hidden Forms topic for more information.

UseKeys

Use this property to specify whether clones of this control can be created when multiple matching targets are found.  See the Cloned Controls topic for more information. Type: Boolean. Set to True to enable creating clones. The value is False by default.

Visible

Sets or gets a True/False value indicating whether the control is displayed.

WaitHandle

Allows callers to wait for the component's creation signal when using the WaitAny or WaitAll components. Type: WaitHandle

Width

Gets or sets the width of the control. Type: Int32

 

Events

 

Event

Description

Click

Occurs when the control is clicked.

Clicking

Occurs when the control is in the process of clicking.

Copy

Occurs when the text in the control has been copied by either the CTRL-C keystroke sequence or when selected as a menu option. This event is also triggered when the Cut event occurs. When the Cut command is used (CTRL-X or menu option), the Copy event fires and then the Cut event fires. Click the drop-down arrow on the event connection block to expose a Text parameter which outputs the text that was Copied.

 

Note: This event is not available for all application types. See the Supported Application Technologies topic for details on where this event is implemented.

Created

Occurs when the control is matched. See the Wait For Create topic. For details on matching, see the OpenSpan knowledge base article Best Practices - Control Lifecycle for more information.

Cut

Occurs when the text in the control has been cut by either the CTRL-X keystroke sequence or when selected as a menu option.  When the Cut command is used (CTRL-X or from menu option), the Copy event fires and then the Cut event fires. Click the drop-down arrow on the event connection block to expose a Text parameter which outputs the text that was Cut.

Note: This event is not available for all application types. See the Supported Application Technologies topic for details on where this event is implemented.

Destroyed

Occurs when the control is unmatched. For details on matching, see the OpenSpan knowledge base article Best Practices - Control Lifecycle for more information.

Disposed

Event included for as part of system references, however it is not used in automations.

DoubleClick

Occurs when the control is double-clicked.

DoubleClicking

Occurs when the control is in the process of double clicking.

EnabledChanged

Occurs when the control is enabled or disabled.

GotFocus

Occurs when the control receives focus.

Hidden

Occurs after a control has been hidden.

KeyDown

Occurs when a key is pressed while the control has focus.

KeyPress

Occurs when a key is pressed while the control has focus.

KeyUp

Occurs when a key is released while the control has focus.

LostFocus

Occurs when the control loses focus.

MouseDown

Occurs when the mouse pointer is over the control and a mouse button is pressed.

MouseUp

Occurs when the mouse pointer is over the control and a mouse button is released.

Paste

Occurs when the text in the control has been pasted from the Windows Clipboard by either the CTRL-V keystroke sequence or when selected as a menu option.  Click the drop-down arrow on the event connection block to expose a Text parameter which outputs the text that was Pasted.

Note: This event is not available for all application types. See the Supported Application Technologies topic for details on where this event is implemented.

RightClick

Occurs when the control is right-clicked.

RightClicking

Occurs when the control is being right-clicked. This is a cancelable event.

Shown

Occurs after a control has been shown.

TextChanged

Occurs when the text in the control is changed.

VisibleChanged

Occurs when the visibility the control is changed.

 

Methods:

 

Method

Description

Parameters

Return Type

Activate

Activates the control and gives it focus within the OpenSpan project.

None

Void

DestroyTooltip

Deletes a tool tip from a control to which it has been assigned.

None

Void

Detach

Un-matches this control from the target that it is matched to. This method is used when an automation might need to force a control to un-match before calling the Rematch or RematchChildren method to re-match controls. Note: Rematch or RematchChildren should only be used when there is an issue which prevents matching from working correctly.

None

Void

Focus

Causes the element to receive the focus and executes the code specified by the GotFocus event.

None

Void

GetClones

Returns a collection of cloned objects. Use the GetClones method in combination with a ListLoop component to iterate over the list of cloned objects to extract individual list items.

None

CloneCollection

GetEvent

Initiates downstream logic pending the occurrence of a particular e vent. Click on the Name parameter in the GetEvent design block to view a list of events applicable for the c omponent. Select the event, and then create a proxy from the GetEvent result. See the Get Event for Windows Controls and Forms topic for more information.

EventName name

Event

GetText

Used to get a large text buffer from a control.

Int32 bufferSize

String

Hide

Removes the control from view. Removes the cell from view. See the UnMatchOnHidden property to understand how hiding an application changes control matching.

None

Void

HideTooltip

Causes the tool tip for the control to be hidden from view.

None

Void

IsKeyAssigned

Verifies that Key is assigned.

String key

Boolean

PerformClick

Simulates a click by causing the Click event to fire. Event is fired asynchronously.  

Asynchronous clicks are executed on a separate thread.  Control returns to the calling thread immediately.

 

None

Void

PerformClick

Simulates a click by causing the Click event to fire. Click is performed at the x and y location specified by the parameters. Event is fired asynchronously.

Asynchronous clicks are executed on a separate thread.  Control returns to the calling thread immediately.

 

Int32 x, Int32 y

Void

PerformDoubleClick

Simulates a double-click by causing the DoubleClick event to fire. Event is fired asynchronously.

Asynchronous clicks are executed on a separate thread.  Control returns to the calling thread immediately.

 

None

Void

PerformDoubleClick

Simulates a double-click by causing the DoubleClick event to fire. Click is performed at the x and y location specified by the parameters. Event is fired asynchronously.

Asynchronous clicks are executed on a separate thread.  Control returns to the calling thread immediately.

 

Int32 x, Int32 y

Void

PerformRightClick

Simulates a right-click by causing the RightClick event to fire. Event is fired asynchronously.

Asynchronous clicks are executed on a separate thread.  Control returns to the calling thread immediately.

 

None

Void

PerformRightClick

Simulates a right-click by causing the RightClick event to fire. RightClick is performed at the x and y location specified by the parameters. Event is fired asynchronously.

Asynchronous clicks are executed on a separate thread.  Control returns to the calling thread immediately.

Int32 x, Int32 y

 

Void

 

PerformSynchronousClick

Simulates a click by causing the Click event to fire. Event is fired synchronously.

Synchronous clicks are executed on the calling thread.  The method waits for all click messages to be processed.

None

Void

PerformSynchronousClick

Simulates a click by causing the Click event to fire. Event is fired synchronously. Note that this method is not implemented for Java 1.4 - 1.6 controls.

Synchronous clicks are executed on the calling thread.  The method waits for all click messages to be processed.

Int32 timeout

Void

PerformSynchronousClick

Simulates a click by causing the Click event to fire. Click is performed at the x and y location specified by the parameters. Event is fired synchronously.

Synchronous clicks are executed on the calling thread.  The method waits for all click messages to be processed.

Int32 x, Int32 y

 

Void

PerformSynchronousClick

Simulates a click by causing the Click event to fire. Click is performed at the x and y location specified by the parameters. Event is fired synchronously. Note that this method is not implemented for Java 1.4 - 1.6 controls.

Synchronous clicks are executed on the calling thread.  The method waits for all click messages to be processed.

Int32 timeout, Int32 x, Int32 y

 

Void

PerformSynchronousDoubleClick

Simulates a double-click by causing the DoubleClick event to fire. Event is fired synchronously.

Synchronous clicks are executed on the calling thread.  The method waits for all click messages to be processed.

None

Void

PerformSynchronousDoubleClick

Simulates a double-click by causing the DoubleClick event to fire. Event is fired synchronously. Note that this method is not implemented for Java  1.4 - 1.6 controls.

Synchronous clicks are executed on the calling thread.  The method waits for all click messages to be processed.

Int32 timeout

Void

PerformSynchronousDoubleClick

Simulates a double-click by causing the DoubleClick event to fire. Click is performed at the x and y location specified by the parameters. Event is fired synchronously.

Synchronous clicks are executed on the calling thread.  The method waits for all click messages to be processed.

Int32 x, Int32 y

Void

PerformSynchronousDoubleClick

Simulates a double-click by causing the DoubleClick event to fire. Click is performed at the x and y location specified by the parameters. Event is fired synchronously. Note that this method is not implemented for Java  1.4 - 1.6 controls.

Synchronous clicks are executed on the calling thread.  The method waits for all click messages to be processed.

Int32 timeout, Int32 x, Int32 y

Void

PerformSynchronousRightClick

Simulates a right-click by causing the RightClick event to fire. Event is fired synchronously.

Synchronous clicks are executed on the calling thread.  The method waits for all click messages to be processed.

None

Void

PerformSynchronousRightClick

Simulates a right-click by causing the RightClick event to fire. Event is fired synchronously. Note that this method is not implemented for Java 1.4 - 1.6 controls.

Synchronous clicks are executed on the calling thread.  The method waits for all click messages to be processed.

Int32 timeout

 

Void

PerformSynchronousRightClick

Simulates a right-click by causing the RightClick event to fire. Click is performed at the x and y location specified by the parameters. Event is fired synchronously.

Synchronous clicks are executed on the calling thread.  The method waits for all click messages to be processed.

Int32 x, Int32 y

 

Void

PerformSynchronousRightClick

Simulates a right-click by causing the RightClick event to fire. Click is performed at the x and y location specified by the parameters. Event is fired synchronously. Note that this method is not implemented for Java 1.4 - 1.6 controls.

Synchronous clicks are executed on the calling thread.  The method waits for all click messages to be processed.

Int32 timeout, Int32 x, Int32 y

Void

Rematch

Refreshes matching on the control and all child controls. If the control is currently matched, OpenSpan detaches (unmatches) the control and children before attempting to rematch. If the control is currently unmatched, you can only call Rematch if the parent is matched.

None

Void

RematchChildren

Refreshes matching on all objects under the control. Set the detach property to True to unmatch all targets before attempting to rematch.

Boolean detach

Void

ResetState

Resets all component properties to their initial values.

None

Void

SendKeys

Sends a key command to a control. See the SendKeys Method topic for more information.

String keys, Boolean focus

Void

SetNextKey

Sets the key for the control when the UseKeys property is True, indicating that clones of this control can be created when multiple matching targets are found.  See the Cloned Controls topic for more information.

String key

Void

Show

Makes the control visible after the Hide method has been called. See the UnMatchOnHidden property to understand how hiding an application changes control matching.

None

Void

ShowContextMenu

Displays a shortcut menu associated with the control.

None

Void

ShowContextMenu

Displays a shortcut menu associated with the control. The menu appears at the x and y location as specified by the parameters.

Int32 x, Int32 y

Void

ShowTooltip

Creates a tool tip for the control. There are 5 overloads of this method (1, 2, 3, 5, 7 parameters). See the Using the ShowToolTip Method topic for more information.

String text, String title,  ToolTipAnchorPosition anchorPosition, Color textColor, Color backgroundColor, Int32 maxWidth, ToolTipIcon icon

Void

WaitForCreate

Waits for the control to be created (matched). Returns True if the control is created before the WaitTimeout period elapses; otherwise, it returns False. See the Wait For Create topic.  For details on matching, see the OpenSpan knowledge base article Best Practices - Control Lifecycle for more information.

None

Boolean

WaitForCreate

Waits for the control to be created (matched). Returns True if the control is created before the specified number of milliseconds has elapsed; otherwise, it returns False. See the Wait For Create topic.  For details on matching, see the OpenSpan knowledge base article Best Practices - Control Lifecycle for more information.

Int32 milliseconds

 

Boolean