Geeks With Blogs
Razi Syed Professional Developer

I was perplexed for days with a weird scenario. If I maximized my MDI child form, after browsing through a few forms, it would start displaying multiple control boxes on top.

I searched for a solution for a while, but no luck. Found this article, which describes almost the same problem but no response: http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.general/2004-08/1063.html. Maybe this guy will come across this post and it might help him (after 4 years! =)

Anyway, the fix is actually very simple, and turned out to be an oversight. The "Main Menu Strip" property on the parent form needs to be set to the menu strip. If it's not, then you will get the wierd behaviour, which is probably a bug in Visual Studio.

On the subjet of menu strips, if you don't want your mdi child menu items to "merge" with the mdi parent menu strip, just set the "AllowMerge" property to False.

 

Posted on Thursday, August 7, 2008 11:50 AM Visual Basic 2005 | Back to top


Comments on this post: Weird Control Box behaviour in MDI form

# re: Weird Control Box behaviour in MDI form
Requesting Gravatar...
Thanks. I was having the similar issue, when child form is maximized it creates its own controlBox above the MDI form menustrip (and well the menustrip on the child form also appears below the MDI menustrip).

When a menustrip is initially added to the a form the MainMenuStrip property on the form is left blank, which is valid because a form can have more tan one menustrip. But if the MainMenuStrip property of the form is not set to manually the problem occur.
Left by Biniam E on Dec 28, 2011 6:39 AM

Your comment:
 (will show your gravatar)


Copyright © razisyed | Powered by: GeeksWithBlogs.net