ZennoLab Assemblies Documentation
MouseButton Enumeration
Example Example 
ZennoLab.Emulation Namespace : MouseButton Enumeration
Specifies the mouse button.
Syntax
public enum MouseButton : System.Enum 
Members
MemberDescription
LeftThe left mouse button.
RightThe right mouse button.
Example
The following code example demonstrates uses of the MouseButton enumeration.
// show the save file dialog
string result = Emulator.MouseClick("Simple window", MouseButton.Left, MouseButtonEvent.Click, 200, 200);
// wait a little bit
System.Threading.Thread.Sleep(2000);
// if mouse click was successful
if (result == "ok" && !Emulator.ErrorDetected)
{
    // click on button with caption "Save"
    result = Emulator.ButtonClick("Save as", "Save");
    // make answer
    if (result == "ok" && !Emulator.ErrorDetected) return "All done";
    else return "Fail";
}
// show the save file dialog
$result = Emulator::MouseClick("Simple window", MouseButton::Left, MouseButtonEvent::Click, 200, 200);
// wait a little bit
System\Threading\Thread::Sleep(2000);
// if mouse click was successful
if ($result == "ok" && !Emulator::ErrorDetected)
{
    // click on button with caption "Save"
    $result = Emulator::ButtonClick("Save as", "Save");
    // make answer
    if ($result == "ok" && !Emulator::ErrorDetected) return "All done";
    else return "Fail";
}
// find the html element
HtmlElement he = instance.ActiveTab.FindElementByTag("input:submit", 0);
// check the element
if (!he.IsVoid)
{
    // click
    string result = Emulator.MouseClick(instance.ActiveTab.Handle, 
        MouseButton.Left, MouseButtonEvent.Click, he.DisplacementInTabWindow.X + 10, he.DisplacementInTabWindow.Y + 10);
    // click was performed
    if (result == "ok") return "All done";
    // fail
    return "Fail";
}
// element not found
return "Element not found";
// find the html element
$he = $instance->ActiveTab->FindElementByTag("input:submit", 0);
// check the element
if (!$he->IsVoid)
{
    // click
    $result = Emulator::MouseClick($instance->ActiveTab->Handle, 
        MouseButton::Left, MouseButtonEvent::Click, $he->DisplacementInTabWindow->X + 10, $he->DisplacementInTabWindow->Y + 10);
    // click was performed
    if ($result == "ok") return "All done";
    // fail
    return "Fail";
}
// element not found
return "Element not found";
Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         ZennoLab.Emulation.MouseButton

Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows Seven

See Also

Reference

ZennoLab.Emulation Namespace
KeyboardEvent Enumeration
MouseButtonEvent Enumeration
MouseClick Method