Mdi child forms sizes and locations manipulation in VB.Net - Help needed


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Mdi child forms sizes and locations manipulation in VB.Net - Help needed

  1. #1
    Join Date
    Sep 2005
    Posts
    2

    Question 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.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    See if this helps:
    http://www.buygold.net/v06n01/v06n01.html

    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?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Sep 2005
    Posts
    2
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center