Show / Hide Table of Contents

Constructor wndChildFinder.wndChildFinder


Overload

See wnd.Child.

public wndChildFinder(string name = null, string cn = null, WCFlags flags = 0, int? id = null, Func<wnd, bool> also = null, int skip = 0)
Parameters
name  (string)

Control name. String format: wildcard expression. null means "can be any". "" means "no name".

By default to get control names this function uses wnd.Name. Can start with these prefix strings:

  • "***text " - use wnd.ControlText. Slower and less reliable because can get editable text. If a character can be underlined with Alt, insert '&' before it.
  • "***elmName " - use wnd.NameElm. Slower.
  • "***wfName " - use .NET Forms control name (see WinformsControlNames). Slower and can fail because of UAC.
cn  (string)

Control class name. String format: wildcard expression. null means "can be any". Cannot be "".

flags  (WCFlags)
id  (int?)

Control id. See wnd.ControlId. Not used if null (default).

also  (Func<wnd, bool>)

Callback function. Called for each matching control. It can evaluate more properties of the control and return true when they match. Example: also: t => t.IsEnabled

skip  (int)

0-based index of matching control. For example, if 1, the function skips the first matching control and returns the second.

Exceptions
ArgumentException
  • name starts with "***", but the prefix is invalid.
  • cn is "". To match any, use null.
  • Invalid wildcard expression ("**options " or regular expression).