C# .NET Menu Problem
Author
Discussion

TheExcession

Original Poster:

11,669 posts

280 months

Monday 7th March 2005
quotequote all
Struggling a bit with this one.

I have an MDI form with its own Main Menu. However when I create a new Form to be shown as an MDI child, even though the child form has it's own Main Menu, the menu doesn't appear on the child form, it is shown on the MDI menu instead.

Any ideas, I'm guessing that there must be a property to set for this MDI child but I'll be buggered if I can find it.

cheers
Ex

>>> Edited by TheExcession on Monday 7th March 11:36

TeamD

5,060 posts

262 months

Monday 7th March 2005
quotequote all
I think it's something to do with the MergeType property of the menuitems but don't quote me on it because I've never tried to implement the scenario that you're describing.

ThatPhilBrettGuy

11,810 posts

270 months

Monday 7th March 2005
quotequote all


MDI child windows NEVER have their own menus on the window. They will always, in a number of ways, end up on the MDI parent. I've seen it faked using context menus before, but to be honest it looked a bit pants.

dilbert

7,741 posts

261 months

Monday 7th March 2005
quotequote all
He's right y'know.

Another way to do it is to define the window as a plain child window, using CreateWindow() rather than CreateMDIWindow(), specifying the menu as a resource in the WNDCLASSEX passed to it.

The trouble with this is that you then have to perform all of the window management for maximise, minimize, tile cascade and activation.

It's a lot of work, and it works out pants in the end, because most normal people can't make sense of it visually. The menu bar is a visual cue for the main frame window.

I think it's also possible for a modal dialog box to have a menu, maybe this is another way around your problem. This sounds like it could be the solution if you're trying to do something with forms.

It could be trickier if you're using form view, and/or have quite a few forms open symultaneously. If this is the case though, it could be worth spending the time to develop a proper visualisation for the data, and build an "application", rather than a form viewing client.

List view, for example, is relatively simple to use and overall you often get a much better result. Depending on what you are doing there might even be a way of visually representing the data.

>> Edited by dilbert on Tuesday 8th March 00:13

TheExcession

Original Poster:

11,669 posts

280 months

Wednesday 9th March 2005
quotequote all
Thanks guys.

I really must be going senile, in all my years of programming I'd never really noticed this.

The App I'm developing has many different open forms in the MDI window and some of the functions on one form are totally inappropriate on another, seemed logical to me just to stick a little menu on the MDI child.

Guess I'll have to rejig them and find some space for some buttons.

best
Ex