Im still curious as to why i was unable to subclass and knock away the menubar, but ive decided to just completely abandon MDI and use setparent instead. I cant believe how much faster the application runs! Switching windows no longer lags flashes and shakes the form around and many of the other problems I was having appear to have vanished.
I only hope that future versions of the framework bring some improvments and a little more flexibility to MDI forms.
Anyway, If anyone does figure out how to get rid of the menubar/control box in an mdi parent please let me know.
Ken, here are the screen shots of the program me and a couple other guys did at the last place I worked at. So there's your ErikMDI, well, sorta anyway ;)
They need some place to put the minimize/maximize/restore/close buttons for the maximized form. Don't see how you're going to convince them to remove that without serious effort. Even if you turn off all those features for the form, the MDI manager in Windows does this for you. Another alternative would be to not display those buttons on the form, then, when the user attempts to maximize the child (or, perhaps you don't even let the user do this, but you do it yourself, in code) and "maximize" the form by sizing and positioning it so that it just fits within the parent window. THis is a lot more work (have to handle resizing, etc.), but it would get you the behavior you want.
I assume you want the child form to Look like it is maximized and fill the parent window without the _■X icons displaying in the right corner of the parents menubar If this is the case then all you need to do when you open the child window is:
Dim NewMDIChild As New frmChild() 'Set the Parent Form of the Child window. NewMDIChild.MDIParent = Me 'Fit the new MDIChild to the Parent Window NewMDIChild.Dock = DockStyle.Fill 'Display the new form. NewMDIChild.Show()
I use this to emulate a GUI that looks like MS Outlook. My child forms have FormBoarderStyle set to NONE
That definately looks good! I would suggest creating your own set of classes similar to this and sell them in the control gallery! Great Job! Oh and yes, ErikMDI is a beautiful thing! ;)
I know for a fact that its possible because the .net magic controls (www.dotnetmagic.com) do it. I looked through the source and found that they subclass the WM_MDISETMENU and WM_MDIREFRESHMENU messages (Menus\MenuControl.cs line 39):
protected override void WndProc(ref Message m) { switch(m.Msg) {
case (int)Win32.Msgs.WM_MDISETMENU:
case (int)Win32.Msgs.WM_MDIREFRESHMENU: return; }
base.WndProc(ref m); }
...I tried using the same method but for some reason beyond all my knowlege it did not work at all.
I would sort of like to get this to work, as i know its possible, but abandoning MDI is a possibility.
Can anyone get subclassing those messages to work Ive exaused all my ideas.
Ah, ErikMDI. It's a beautiful thing. Actually, it is very nice. And gives you a lot of flexibility that locking yourself into the standard MDI doesn't. Looks great!
Right, but then the'yre not MDI, which is a very specific spec. What you've got is ErikMDI, which isn't MDI<> There's nothing wrong with that, but it shouldn't be necessary. I would suggest a look/feel so different that it doesn't seem like MDI modified. Or, maybe that's what you've done.
[VB.NET] Hiding menubar of MDI parent
MilwaukeeCharlie
......
......
Anyway.
Im still curious as to why i was unable to subclass and knock away the menubar, but ive decided to just completely abandon MDI and use setparent instead. I cant believe how much faster the application runs! Switching windows no longer lags flashes and shakes the form around and many of the other problems I was having appear to have vanished.
I only hope that future versions of the framework bring some improvments and a little more flexibility to MDI forms.
Anyway, If anyone does figure out how to get rid of the menubar/control box in an mdi parent please let me know.
Regards,
FireRabbit
lumpynose
Ken, here are the screen shots of the program me and a couple other guys did at the last place I worked at. So there's your ErikMDI, well, sorta anyway ;)
The Formula Showroom:
<a href="http://www.erikporter.com/images/s1.png">Screenshot 1</a>
<a href="http://www.erikporter.com/images/s2.png">Screenshot 2</a>
<a href="http://www.erikporter.com/images/s3.png">Screenshot 3</a>
<a href="http://www.erikporter.com/images/s4.png">Screenshot 4</a>
<a href="http://www.erikporter.com/images/s5.png">Screenshot 5</a>
<a href="http://www.erikporter.com/images/s6.png">Screenshot 6</a>
</thread_interruption>
smgraham
antho
Matthew McDonald
Dim NewMDIChild As New frmChild()
'Set the Parent Form of the Child window.
NewMDIChild.MDIParent = Me
'Fit the new MDIChild to the Parent Window
NewMDIChild.Dock = DockStyle.Fill
'Display the new form.
NewMDIChild.Show()
I use this to emulate a GUI that looks like MS Outlook. My child forms have FormBoarderStyle set to NONE
Stathread01
That definately looks good! I would suggest creating your own set of classes similar to this and sell them in the control gallery! Great Job! Oh and yes, ErikMDI is a beautiful thing! ;)
Jason
Henry Chan
protected override void WndProc(ref Message m)
{
switch(m.Msg)
{
case (int)Win32.Msgs.WM_MDISETMENU:
case (int)Win32.Msgs.WM_MDIREFRESHMENU:
return;
}
base.WndProc(ref m);
}
...I tried using the same method but for some reason beyond all my knowlege it did not work at all.
I would sort of like to get this to work, as i know its possible, but abandoning MDI is a possibility.
Can anyone get subclassing those messages to work Ive exaused all my ideas.
Thanks for the replys,
FireRabbit
GregStroud
Zamial
Kyaw N Paing
Sealed
try this one :
when u call child form. in the button click event add this line
menuitem(want to hide).MergeType= MenuMerge.Remove ;