I have a Tabbed MDI Container. When I maximize the tabs, I get the following menu. I don't want the user to have the ability to close the tabs. How do I disable this menu?
http://www.benefitsinacard.com/images/misc/sample_menu.jpg
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Scott LysleRank #49 · 31K reputationPosted Mar 4, 2007, 1:53 AM EST
Brad Shannon11 reputationPosted Mar 5, 2007, 3:25 AM EST
Brad Shannon11 reputationPosted Mar 6, 2007, 3:29 AM EST
Any other ideas?
Scott LysleRank #49 · 31K reputationPosted Mar 7, 2007, 11:25 PM EST
Scott LysleRank #49 · 31K reputationPosted Mar 7, 2007, 11:44 PM EST
protected
override void WndProc(ref System.Windows.Forms.Message m){
if (m.Msg != 0x0010)
{
base.WndProc(ref m);
}
else
{
//do nothing
}
}
Brad Shannon11 reputationPosted Mar 8, 2007, 2:14 AM EST
Ok that code disabled it, but it didn't go away. Yes, I want both forms maximized, but I don't want that control box there. Thanks for your help so far by the way...
Scott LysleRank #49 · 31K reputationPosted Mar 8, 2007, 4:23 PM EST
Outside of using a borderless form (which surely won't show a control box) I believe there is a way in the API that you can block the display of the close X; I will look into that.
Brad Shannon11 reputationPosted Mar 9, 2007, 3:30 AM EST
I tried the borderless form and it crashes the program. I'm wondering if all of this isn't working because of the tabs?
Scott LysleRank #49 · 31K reputationPosted Mar 10, 2007, 5:59 PM EST
I would not think so, I built a demo project to look at the problem and I had a main MDI form with tabs and it did not present any problems. Did you try building a clean project to see if you could get some of other things to work (like the controlbox property?).
Brad Shannon11 reputationPosted Mar 12, 2007, 3:46 AM EDT
I have not tried that yet. I'm fairly new to C#. Would you be willing to share the code you used for your tabbed MDI Container?
Brad