# Mouse click

![](https://1755238209-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNnEkyZmLMSWTDXxpygbG%2Fuploads%2Fgit-blob-cb9be7a917e000983bd0a55894340f58b7d1c2d1%2F0%20\(136\).png?alt=media)

Element mouse-clicking a selected control element. The component works correctly only inside the Connect to an Application container.

![](https://1755238209-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNnEkyZmLMSWTDXxpygbG%2Fuploads%2Fgit-blob-07fc790c8c996dfea29ef2bfb83d9a6ebe2da417%2F1%20\(109\).png?alt=media)

Properties

\- Search template: \[String] Control element search template

\- Element: \[LTools.Desktop.Model.DUIControl] Reference to a control element

\- Coordinates: \[System.Drawing.Rectangle] Cursor click coordinates

\- Keyboard key

\- Mouse key

\- Timeout\*: \[Int32] Maximum waiting time for process completion (ms)

```
C#
LTools.Desktop.DesktopApp app = LTools.Desktop.DesktopApp.Init(wf, null, "Test_*", 20000, true, LTools.Desktop.Model.DesktopTypes.UIAUTOMATION);
//Search temaplate + Mouse click + Keyboard
app.Click("{\"Name\":\"Hide\",\"AutomationID\":\"btnVanish\",\"ClassName\":\"Button\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}", 
		LTools.Desktop.Model.MouseButtons.BUTTON_LEFT, LTools.Desktop.Model.KeyboardKeys.CTRL, 20000);
//Component link
LTools.Desktop.Model.DUIControl el = app.FindElement("{\"Name\":\"Hide\",\"AutomationID\":\"btnVanish\",\"ClassName\":\"Button\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}");
app.Click(el);
//Coordinates
app.Click(new System.Drawing.Rectangle(100, 150, 0, 0));

Python
app = LTools.Desktop.DesktopApp.Init(wf, None, "Test_*", 20000, True, LTools.Desktop.Model.DesktopTypes.UIAUTOMATION)
#Search temaplate + Mouse click + Keyboard
app.Click("{\"Name\":\"Hide\",\"AutomationID\":\"btnVanish\",\"ClassName\":\"Button\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}", 
		LTools.Desktop.Model.MouseButtons.BUTTON_LEFT, LTools.Desktop.Model.KeyboardKeys.CTRL, 20000)
#Component link
el = app.FindElement("{\"Name\":\"Hide\",\"AutomationID\":\"btnVanish\",\"ClassName\":\"Button\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}")
app.Click(el)
#Coordinates
app.Click(System.Drawing.Rectangle(100, 150, 0, 0))

JavaScript
var app = _lib.LTools.Desktop.DesktopApp.Init(wf, null, "Test_*", 20000, true, _lib.LTools.Desktop.Model.DesktopTypes.UIAUTOMATION);
//Search temaplate + Mouse click + Keyboard
app.Click("{\"Name\":\"Hide\",\"AutomationID\":\"btnVanish\",\"ClassName\":\"Button\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}", 
	_lib.LTools.Desktop.Model.MouseButtons.BUTTON_LEFT, _lib.LTools.Desktop.Model.KeyboardKeys.CTRL, 20000);
//Component link
var el = app.FindElement("{\"Name\":\"Hide\",\"AutomationID\":\"btnVanish\",\"ClassName\":\"Button\",\"AUIProperties\":[],\"TextSearchMode\":0,\"IsRoot\":false,\"IsQuickSearch\":false}");
app.Click(el);
//Coordinates
app.Click(new _lib.System.Drawing.Rectangle(100, 150, 0, 0));
```
