Mdi child forms sizes and locations manipulation in VB.Net - Help needed
My application manipulates sizes and locations of Mdi child forms in runtime. Ideally, I would like to manipulate the size and location of a child form while the form is in hidden state and than show it at the right place in the right size (to prevent flickering) however, when I try to extract the point to screen, location or size of the form or of any of its child controls before I call the Show() method, I sometimes get values that just don't make sense.
Does anybody have an idea?
Thanks in advance.
See if this helps:
If not, can you be more specific about which values "don't make sense?" What are you seeing, and what do you expect to see?
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
Thanks for the link Phil. Unfortunately, the information didn't help.
I'll be more specific and try to simplify the scenario I'm facing:
I have an MDI form which contains a fill panel that contains an image control. Upon a click of a button, a new panel is being dynamically added to the image control in a certain location and size.
Now comes the tricky part: when clicking the new panel, a new MDI child form is being created and the panel is removed from the image control and added to the newly created child form (in fill docking). The child form's client area size (which now contains the newly added panel) should be the same as the panel size and should appear in the exact same location on the image control that the panel was previously located. To calculate the exact size and location of the new child form, before removing the panel from the image control, I store the point to screen of the panel location and the panel size. Before adding the panel to the form, I would like to resize the form to the right size and locate it's client areain the same stored location.
What I would like to do is to hide the form, calculate it's new location and size, add the panel and show it in it's new location and size. The problem is that when I try to extract the client area point-to-screen of the hidden form, I get a totally different number than the number I get when the form is visible. Moreover, whenever I set the form size in hidden state, the new size actually applies only when I call the Show() method and the actual resizing takes place only when the form is visible (which causes flickering).
I hope I didn't wear you with this long description
Your help is highly appreciated.
Thanks in advance.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL