all groups > vb.net > february 2004 >
You're in the

vb.net

group:

Position owned form relative to owner form on screen


Position owned form relative to owner form on screen Dean Slindee
2/2/2004 11:23:20 PM
vb.net:
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

RE: Position owned form relative to owner form on screen v-phuang NO[at]SPAM online.microsoft.com
2/3/2004 9:17:51 AM
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.
RE: Position owned form relative to owner form on screen v-phuang NO[at]SPAM online.microsoft.com
2/5/2004 9:08:26 AM
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.
AddThis Social Bookmark Button