Class Form
- Namespace
- Ranorex
- Assembly
- Ranorex.Core.dll
Represents an application main window or a dialog window.
public class Form : Adapter, IAdapter
- Inheritance
-
Form
- Implements
- Inherited Members
Constructors
Form()
Creates a new Form adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!
protected Form()
Form(Element)
Creates a new Form adapter instance.
public Form(Element element)
Parameters
elementElementThe element to create the adapter for.
Exceptions
- NullReferenceException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
Properties
Active
True if the form is the currently active window.
public virtual bool Active { get; }
Property Value
AppIcon
The application icon if available.
public virtual Icon AppIcon { get; }
Property Value
RequiredCapabilities
Capabilities required by the adapter implementation.
protected override string[] RequiredCapabilities { get; }
Property Value
- string[]
State
The state of the form or application window.
public virtual FormWindowState State { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
Title
The title of the form or application window.
public virtual string Title { get; }
Property Value
Methods
Activate()
Activates the form by bringing it to the foreground.
public virtual void Activate()
Exceptions
- ActionFailedException
Thrown if invoking the action failed.
Close()
Closes the form.
public virtual void Close()
Exceptions
- ActionFailedException
Thrown if invoking the action failed.
FromElement(Element)
Converts an Element to an instance of this class.
public static Form FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- Form
The Form.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
FromPath(string)
Converts a string to an instance of this class by searching the root.
public static Form FromPath(string path)
Parameters
pathstringThe search path.
Returns
- Form
The Form.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis not valid.- ElementNotFoundException
If no element is found.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
Maximize()
Maximizes the form.
public void Maximize()
Minimize()
Minimizes the form.
public void Minimize()
Move(int, int)
Moves the form to a new location.
public virtual void Move(int x, int y)
Parameters
Exceptions
- ActionFailedException
Thrown if invoking the action failed.
Resize(int, int)
Sets the size of the form.
public virtual void Resize(int width, int height)
Parameters
Exceptions
- ActionFailedException
Thrown if invoking the action failed.
Restore()
public void Restore()
Operators
implicit operator Form(Element)
Implicitly converts an Element to an instance of this class.
public static implicit operator Form(Element element)
Parameters
elementElementThe element to convert.
Returns
- Form
The Form.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
implicit operator Form(string)
Implicitly converts a string to an instance of this class by searching the root.
public static implicit operator Form(string path)
Parameters
pathstringThe search path.
Returns
- Form
The Form.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis not valid.- ElementNotFoundException
If no element is found.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.