| ZennoLab.Emulation Assembly > ZennoLab.Emulation Namespace : MouseButton Enumeration |
public enum MouseButton : System.Enum
| Member | Description |
|---|---|
| Left | The left mouse button. |
| Right | The right mouse button. |
// 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";
System.Object
System.ValueType
System.Enum
ZennoLab.Emulation.MouseButton
Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows Seven