Click here to Skip to main content
11,926,805 members (55,290 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# .NET C#4.0 .NET4
Hi Frinds,
iam using C#.Net Windows Application..In my project have different module that will be used by MDI..
now what the problem is,i can open a new form mean, in right top corner they will display icon as maximize,minimize and Close in both MDI and Menustrip..
I want to show only the icon in can Remove child forms icons(Maximize,Minimize and Close) from menustrip
Posted 22-Jun-13 6:56am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

try this
There is property named MaximizeBox, set it false and
another named MinimizeBox set it false.

private const int CP_NOCLOSE_BUTTON = 0x200;
protected override CreateParams CreateParams
       CreateParams myCp = base.CreateParams;
       myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON ;
       return myCp;
guyzfree 22-Jun-13 12:22pm
Basmeh Awad, ya its working...but it will only disable Close Button Only..then wht about the Maximize and Minimize icon..i Set False to the Max and Min Property, but cant Disable...And the code will use in each and every form?....
Basmeh Awad 22-Jun-13 12:28pm
yes..the code you will have use in every form...
i didnt understand this "then wht about the Maximize and Minimize icon.."
didnt you set the property to false in forms property window
guyzfree 22-Jun-13 12:48pm
yes,i Set False to the Max and Min Property, but cant Disable
Basmeh Awad 23-Jun-13 2:47am
you can hide the button by setting true or false in runtime..but there is no property like disable..
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Hi Friends,
I solved this problem,In the child form load event i have set the following properties,
this.ControlBox = false;
this.MaximizeBox = false;
this.MinimizeBox = false;
But, even-though you could not Success, go to the designer page under FormName put this,
this.ControlBox = false;
this.ShowIcon = false;
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Private Sub Form4_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
If Me.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Normal
End If

End Sub
CHill60 17-Jun-14 12:56pm
Apart from the fact the question is a year old, your solution is VB (OP tagged C#) and is completely the wrong way to go about it

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.1 | Last Updated 17 Jun 2014
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100