Show / Hide Table of Contents

Method wnd.ButtonClick(+ 1 overload)


Overload

Finds and clicks a button in this window. Does not use the mouse.

public void ButtonClick(int id)
Parameters
id  (int)

Control id of the button. See wnd.Child.

Exceptions
AuWndException

This variable is invalid (window not found, closed, etc).

NotFoundException

Button not found.

Remarks

This function just calls wnd.Child and mouse.postClick. Uses this code: mouse.postClick(this.Child(1, id: id));

Examples

wnd.find("Options").ButtonClick(2);

Overload(top)

Finds and clicks a button in this window. Does not use the mouse.

public void ButtonClick(string name, bool asControl = false, string roleCN = null)
Parameters
name  (string)

Button name. String format: wildcard expression.

asControl  (bool)

If true, finds/clicks as child control: mouse.postClick(this.Child(1, name, roleCN ?? "*Button*"));. If false, finds/clicks as UI element: this.Elm[roleCN ?? "BUTTON", name].Find(1).Invoke();. Default is false; it's slower but works with more windows.

roleCN  (string)

UI element role or control class name (if asControltrue). String format: wildcard expression. Default role is "BUTTON", class name "*Button*".

Exceptions
ArgumentException

Invalid name (when starts with "***"). See elmFinder.this[], wnd.Child.

AuWndException

This variable is invalid (window not found, closed, etc).

NotFoundException

Button not found.

AuException

Failed to click. For example need to activate the window. No exception if asControltrue.

Remarks

This function is just a shorter way to call other functions that have more options but require more code to call. If asControltrue, it calls wnd.Child and mouse.postClick. Else wnd.Elm, elmFinder.this[], elmFinder.Find and elm.Invoke.

Examples

wnd.find("Options").ButtonClick("Cancel");