I can't disable the maximize and minimize box without setting ControlBox = False when the child form is maximized, anyone know the workaround for this?
I have set the mdi child form property as below:
FormBorderStyle = FixedSingle
ControlBox = True
MaximizeBox = False
MinimizeBox = False
WindowState = Maximized
I am able to fix this by doing the following:
ChildForm.WindowState = Normal;
ChildForm.MDIParent = this;
ChildForm.Show();
ChildForm.WindowState = Maximized;
what happen was, when I open 2nd child form, the minimized box enabled again....
Loading

FroglegRank #1,020 · 1.9K reputationPosted Mar 30, 2011, 4:52 AM EDT
In the list, select ItemAdded and double click
this will appear in code window
private void menuStrip1_ItemAdded(object sender, ToolStripItemEventArgs e)
{
***
}
Add this where the asterisk is and see if thats what you want
string s =(e.Item.GetType().ToString()) ;
if (s == "System.Windows.Forms.MdiControlStrip+ControlBoxMenuItem")
{
e.Item.Visible = false ;
}
so you should have this
private void menuStrip1_ItemAdded(object sender, ToolStripItemEventArgs e)
{
string s =(e.Item.GetType().ToString()) ;
if (s == "System.Windows.Forms.MdiControlStrip+ControlBoxMenuItem")
{
e.Item.Visible = false ;
}
}
FroglegRank #1,020 · 1.9K reputationPosted Mar 30, 2011, 2:47 AM EDT
eddom33 reputationPosted Mar 30, 2011, 3:00 AM EDT
FroglegRank #1,020 · 1.9K reputationPosted Mar 30, 2011, 3:13 AM EDT
You can set Minimum size and Maximum size to the same amount so the form cannot be resized
eddom33 reputationPosted Mar 30, 2011, 3:21 AM EDT
FroglegRank #1,020 · 1.9K reputationPosted Mar 30, 2011, 4:01 AM EDT
eddom33 reputationPosted Mar 30, 2011, 4:06 AM EDT
FroglegRank #1,020 · 1.9K reputationPosted Mar 30, 2011, 4:18 AM EDT
private void PatientDatabaseForm_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
}
will stop close button
eddom33 reputationPosted Mar 30, 2011, 4:21 AM EDT
btw, I am able to disable/hide everything by setting the ControlBox = false, but again, users only do not allow to restore ("-" symbol) and minimize the windows, closing of windows is allowed. :)
FroglegRank #1,020 · 1.9K reputationPosted Mar 30, 2011, 4:25 AM EDT
eddom33 reputationPosted Mar 30, 2011, 4:29 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Mar 30, 2011, 2:44 PM EDT
eddom33 reputationPosted Mar 30, 2011, 9:59 PM EDT
eddom33 reputationPosted Mar 30, 2011, 10:00 PM EDT
eddom33 reputationPosted Mar 31, 2011, 1:16 AM EDT
Pankaj Gupta4 reputationPosted Jan 21, 2015, 10:26 PM EST
I have same requiremet as you want. I have tried a lot but still not able to fullfill the requirement. Please give some suggestion that how may i do?
Priyamtheone59 reputationPosted Aug 6, 2015, 8:12 AM EDT
Priyamtheone59 reputationPosted Aug 6, 2015, 8:16 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Jan 22, 2015, 9:11 AM EST