954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

VB.Net MDI forms not locating properly

I have a problem with MDI forms and their location. I have a container form within which I open several child forms. Also note that in the container form I have a ToolStrip at the top and it is also docked to the top. In each of the child forms I have set the following properties. I have set them at design time as well but it wasn't working for some reason so I put them in the form_load event as well.
[CODE]
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Me.Dock = DockStyle.Fill
ReSizeAndArrange(Me.Width, Me.Height, False)
[ICODE]

The function ReSizeAndArrange is called on form_load and form_layout events. The problem I am having is that the child forms do not fill the remaining space correctly or for that matter the entire parent form. When I step through, here are the coordinates I am getting for the child form.

frmContainer.Size {Width = 972 Height = 972} System.Drawing.Size
me.Size {Width = 968 Height = 901} System.Drawing.Size
frmContainer.ToolStripMain.Size {Width = 954 Height = 67} System.Drawing.Size
frmContainer.Location {X = 90 Y = 22} System.Drawing.Point
me.Location {X = -9 Y = -36} System.Drawing.Point

Shouldn't the Me.Location be 0,0? the numbers add up on the sizes (I think). The 4 pixel difference can perhaps be explained by the border. However, the location is unexplained. Can anyone decipher this?

anilgupte
Newbie Poster
1 post since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: