title: How to click on a position of form or a control automatically?
body: <p>I'm using Visual Basic 2008 (VB.NET) and I have an old control which have some buttons on it. These buttons can not be pressed without actual click and the control have no event or API for that. The control is something like the picture below which has multiple objects and buttons as a single control which controls inside the control can be changed dynamically according to some conditions but at a fixed place and this is why I think simulating a click that I said is the best way in my opinion:<br>(The actual control is completely different that the picture below. It's only a sample)<br>
  <img src="https://i.stack.imgur.com/Ls5ga.png" alt="enter image description here"></p>
  
  <p><p>
  I can click on the button by doing these steps:</p>
  
  <ol>
  <li><p>Collecting all controls positions on my form</p></li>
  <li><p>Moving the control in order to put the button exactly at the left top of the form</p>
  
  <blockquote>
    <p>MyControl.Left = -43<br>
    MyControl.Top = -6</p>
  </blockquote></li>
  <li><p>Moving form exactly to the center of the screen</p>
  
  <blockquote>
    <p>Me.Location = New Point(Screen.PrimaryScreen.WorkingArea.Width / 2 - 1, Screen.PrimaryScreen.WorkingArea.Height / 2 - 1)</p>
  </blockquote></li>
  <li>Simulating a click action at the center of the screen</li>
  <li>Moving back controls to their positions that I got in the first step</li>
  </ol>
  
  <p>It can be done that way but it's not reliable and it might not be user friendly for my program customers.<p>
  I want to ask if there are any better method to do that like simulating a click event on a position on the form itself (so I don't have to move controls and do other steps)?</p>