Position owned form relative to owner form on screen

  • Thread starter Thread starter Dean Slindee
  • Start date Start date
D

Dean Slindee

I would like to show an owned form at a predetermined spot on the screen
relative to the the owner form's position on the screen (example:
frmOwner.Top + 100 and frmOwner.Left + 50). How to do?

Thanks,
Dean Slindee
 
Hi Dean,

Thanks for posting in the community.

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you wants to display the owned
form at a predetermined spot on the screen.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

Here I write some code for you, if you have concern on this issue, please
post here.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim fm As New Form2
fm.StartPosition = FormStartPosition.Manual
fm.Owner = Me
fm.Top = Me.Top + Int32.Parse(TextBox1.Text)
fm.Left = Me.Left + Int32.Parse(TextBox2.Text)
fm.Show()
End Sub


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Dean,

Thanks for posting in the community.

Did my suggestion help you?
If you have any concern on this issue, please post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top