ACAT.Lib.Core.Utility.Windows.ClickOnWindow C# (CSharp) Метод

ClickOnWindow() публичный статический Метод

Simulates a mouse click on the specified control
public static ClickOnWindow ( Control control ) : void
control System.Windows.Forms.Control the control
Результат void
        public static void ClickOnWindow(Control control)
        {
            if (control.Visible)
            {
                int xpos = control.Left + 5;
                int ypos = control.Top + 5;

                Point oldPos = Cursor.Position;
                MouseUtils.ClickLeftMouseButton(xpos, ypos);
                Cursor.Position = oldPos;
            }
        }

Usage Example

Пример #1
0
 /// <summary>
 /// Set focus to this scanner
 /// </summary>
 /// <param name="sender">event sender</param>
 /// <param name="e">event args</param>
 private void SwitchLanguageScanner_Shown(object sender, EventArgs e)
 {
     Windows.SetForegroundWindow(Handle);
     Windows.ClickOnWindow(this);
 }
All Usage Examples Of ACAT.Lib.Core.Utility.Windows::ClickOnWindow