title: set Form Location Relevant to Parent Form Button
body: <p>I have a MDI(Parent) Form and 2 other Forms. On form1 there is a button, location is (X:100, Y:200). I required when user click on the button through Form1, another form "Form2" should open. And location of Form2 should be right middle of the button(Sender).</p>
  
  <p>I write this code</p>
  
  <pre>
     Private Sub UpdateLocation(ByVal element As Control, ByVal frm As Form)
          Dim p As New Point(element.Location)
          p = element.PointToScreen(p)
          p.X = p.X + element.Width + 10
          p.Y = p.Y / 2
  
          Debug.Print(p.ToString)
          frm.Location = p
          frm.BringToFront()
      End Sub
  </pre>
  
  <p>but Form2 location is not as expected. 
  In am calling the above function on button click event</p>
  
  <pre>
      UpdateLocation(form1.button1, form2)
  </pre>
  
  <p>Any help would be appreciable.
  Thanks in advance.</p>
  
  <p>Output of the above code is:</p>
  
  <p><a href="http://goo.gl/yfbLS" rel="nofollow">Button1_Click</a></p>
  
  <p>After a few tests I realized that point.x (location.x) is working, but not the point.y (location.y)</p>
  
  <p><a href="http://www.softnsolv.com/temp/FormLocation.zip" rel="nofollow">You can download the piece of code from here</a>. you can check the  actual issues with it.
  VS2010 is required.</p>