Specifies the mouse button.
Syntax
Members
Example
The following code example demonstrates uses of the
MouseButton enumeration.
| C# | Copy Code |
|---|
// 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";
} |
| PHP | Copy Code |
|---|
// 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";
} |
| C# | Copy Code |
|---|
// 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"; |
| PHP | Copy Code |
|---|
// 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
Requirements
Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
See Also