|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Badly behaving child in MDI applicationconsecutive MDI child forms, suddenly the forms were cascaded. This is not what I want. Does anyone know how to 'turn this off'????? Also, when I resize the child form to fit the Client of the parent MDI, to get the correct values, I use the following code. Shared Sub FitChildToMDI(ByVal frmMDI As Form, ByVal frmChild As Form) frmChild.Top = 0 frmChild.Left = 0 frmChild.Height = frmMDI.ClientRectangle.Size.Height - 4 frmChild.Width = frmMDI.ClientRectangle.Size.Width - 4 End Sub If I subtract less than 4, I get scroll bars which I definately do not want. Why do I need the minus 4???? Iz there some property of the client rectangle which has a value 4 at the screen resolution that I am using BUT may have a different value for a different screen resolution. Microsoft HELP was very very very very helpful on this point and I got 100 results to my query 'ClientRectangle'. None of them even intimated an answer to these questions. There was loads and loads and loads and loads of info on stuff that had no relavence to my problems. Is it me or is it Microsoft????? Garry Garry wrote:
Show quoteHide quote > While trying to write good 'best practices' vb.net code to 'show' It's you. Microsoft gives you so much information, at times it seems> consecutive MDI child forms, suddenly the forms were cascaded. > > This is not what I want. > > Does anyone know how to 'turn this off'????? > > Also, when I resize the child form to fit the Client of the parent MDI, to > get the correct values, I use the following code. > > Shared Sub FitChildToMDI(ByVal frmMDI As Form, ByVal frmChild As Form) > frmChild.Top = 0 > frmChild.Left = 0 > frmChild.Height = frmMDI.ClientRectangle.Size.Height - 4 > frmChild.Width = frmMDI.ClientRectangle.Size.Width - 4 > End Sub > > If I subtract less than 4, I get scroll bars which I definately do not want. > > Why do I need the minus 4???? Iz there some property of the client rectangle > which has a value 4 at the screen resolution that I am using BUT may have a > different value for a different screen resolution. > > Microsoft HELP was very very very very helpful on this point and I got 100 > results to my query 'ClientRectangle'. None of them even intimated an answer > to these questions. There was loads and loads and loads and loads of info on > stuff that had no relavence to my problems. > > Is it me or is it Microsoft????? > > Garry like its hard to wade through. Out of all the things i complain about in the Microsoft world, documentation is rarely one of them. The four is the border of the MDI client. To get the client area size of the MDI form, you need to check the MDIClient's size, not the MDI itself. I posted about that here: <URL: http://groups.google.com/group/microsoft.public.dotnet.framework/browse_frm/thread/4e9d658a72c36f64>. HTH, B.
ANN: .NET 3.0 Final
Attach handlers to ToolStripMenuItems. Got stacked, Please Help MDI gets FormClosing but non-Child forms also open do not. Error when laoding word from vb.net 2005 Multithread Design Question FOR SALE : Apple iPod 60GB,--------------------$150 Drawing help database selection in deployment Window Combo box Treeview - relative position |
|||||||||||||||||||||||