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
FroglegPosted Mar 30, 2011, 8:52 AM
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 ;
}
}
PriyamtheonePosted Aug 6, 2015, 12:16 PM
PriyamtheonePosted Aug 6, 2015, 12:12 PM
Sam HobbsPosted Jan 22, 2015, 2:11 PM
Pankaj GuptaPosted Jan 22, 2015, 3:26 AM
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?
eddomPosted Mar 31, 2011, 5:16 AM
eddomPosted Mar 31, 2011, 2:00 AM
eddomPosted Mar 31, 2011, 1:59 AM
Sam HobbsPosted Mar 30, 2011, 6:44 PM
eddomPosted Mar 30, 2011, 8:29 AM
FroglegPosted Mar 30, 2011, 8:25 AM
eddomPosted Mar 30, 2011, 8:21 AM
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. :)
FroglegPosted Mar 30, 2011, 8:18 AM
private void PatientDatabaseForm_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
}
will stop close button
eddomPosted Mar 30, 2011, 8:06 AM
FroglegPosted Mar 30, 2011, 8:01 AM
eddomPosted Mar 30, 2011, 7:21 AM
FroglegPosted Mar 30, 2011, 7:13 AM
You can set Minimum size and Maximum size to the same amount so the form cannot be resized
eddomPosted Mar 30, 2011, 7:00 AM
FroglegPosted Mar 30, 2011, 6:47 AM