Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving a form from other objects
Message
From
05/03/2004 21:40:27
 
 
To
05/03/2004 14:53:45
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00883638
Message ID:
00883749
Views:
9
Well, Steve, since no one's answered this all day, lemme take a shot at it. I'm not sure at what point the Form's Layout event fires, but I'm betting it's during the Load sometime. How about if you try adding a public method to your form that does the .SetBounds() and then call that method after you instantiate the form, but before you .Show() it ... something like this (hope I got the VB syntax right):
Dim oForm As New MyForm()
oForm.SetTheBounds("parms here if needed")
oForm.Show()
You probably won't need the Layout eventhandler in your form now. But, if I'm wrong about when the Layout event fires, then this might not work. I haven't tested it, but try it out and see what happens. If it doesn't work, I'm sure there's some variation on the theme that will.

~~Bonnie


>Hi:
>
>I’m trying to programmatically move a form to a different location from another form. When I’m in a form I can do the following:
>
>Private Sub oForm_Layout(ByVal sender As Object, ByVal e As System.Windows.Forms.LayoutEventArgs) Handles MyBase.Layout
>
> oForm.SetBounds(0, 0, 100, 300)
>
>end sub
>
>And it works great. However, I want to move this form from say another form. Any idea’s?
>
>Thanks, Steve
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform