how to remove the default control buttons from a windows form - c#

The image describes what I am trying to do.
I have a "connect four" game which works perfectly well but I want to remove the default buttons provided at the top right hand corner of the window. Any quick help on this?

Click here to view steps in video
Please Set ControlBox Value as "False" of your desire form.

The ControlBox property of Forms does this after hiding the Minimize and Maximize buttons.
MSDN - Form.ControlBox Property

In the properties window for your form designer, there should be a listing for MaximizeBox and MinimizeBox that you can set to false to disable the maximize and minimize buttons on the form. AFAIK there is no way to disable the close button.

Related

Automatically open maximized and fit correctly

Does anyone at all know how to get C# GUI programs to automatically open maximized and fit correctly in whatever screen resolution is on the computer?when I run and maximize the application the tablepage(Control) is not maximize and as well as other controls.please help me with details...
Use the WindowState property: https://msdn.microsoft.com/en-us/library/system.windows.forms.form.windowstate(v=vs.110).aspx
Set the property to Maximized before you show the form.
If you want your controls to resize with the window, use the Anchor and Dock properties in the Forms Designer.
Use Anchor to have a control's edge be a fixed distance from a given edge, and use the Dock property to have a control fill an area.

window state maximize not working

I am opening a form in a mdi parent. I show the form in the parent and the window state of the new form in the designer is maximized. For some reason, the form appears in the top left corner of the mdi parent, and the control box is way over to the right as if it was maximized, but the size of the window is not filling up the screen. So the behavior is as if it were maximized, but it is not filling the screen. What should I do?
I'm using C#.Net Winform.
Set your child form's window state to maximized.
This will maximize your form.
childForm.WindowState = FormWindowState.Maximized;
You can do this on load of your MdiParent form, or whenever you open show this child form.
Make sure your MdiChilds MaximumSize Property is not set. If it is it will look like this, which looks like what you have described in your question.
Coming in late, but I too am having this problem and so far nobody's answered why it's happening. I found this discussion on MSDN that explains more of what is really a workaround suggested by #nunespascal:
Basically I can't set WindowState to Maximised in the Designer, but if I leave it set to Normal and then when loading the form in code I set it to Maximised it works.
This is also the answer provided in this StackOverflow post.

Can't keep WinKey+Up from moving my form

I am trying to set a window at the bottom right of my screen. Its FormBorderStyle is set to None. I don't want the user to have the ability to move it around. Unfortunately, if the user presses Winkey+Up (maximize in Win7), it will relocate the form to (0,0) on my desktop.
I tried resetting the location in the LocationChanged event but when I changed the Left/Top or Location properties, they would not actually change.
Does anybody have any ideas on how I can resolve this?
Thanks!
You can't programmatically change your form's location if it is maximized. You'll need to change its WindowState property to FormWindowState.Normal before trying to set its location.
You need a GlobalSystemHook, and itsn't a trivial work.
At this url (CodeProject) there is an useful example.
Set your FormBorderStyle to one of FixedSingle, Fixed3D, FixedDialog or FixedToolWindow AND set MaximizeBox and MinimizeBox to false.

Delete icon from MDI container form

I have a parent form and some child forms. Each of the child form has an icon at the top and left of the form. I would like to discard those icons but when I click on the icon property, I can only browse another icon and not delete the existing one. For that reason I set the showIcon property in each child form to false and the icons are not visible any more on the forms. So far so good.
My problem is that when a child form is open and maximized, the icon is shown. I want to make it go away and unfortunately I didn't find a way to do this. Any suggestions?
Thanks!
EDIT: I added a screenshot of the form, the unwanted icon is shown above menu strip. I want it to go away. When child form is NOT maximized, the icon disappears.
I guess you need to create a custom form border.
Please check http://geekswithblogs.net/kobush/articles/CustomBorderForms3.aspx

Hide the Resize arrow in the form C#

In my C# application I have set the form border to Fixed3D, as I don't want to re-size it. However, the arrow on the bottom right of the form still appears for re-size even though it doesn't allow re-sizing.
How do I hide that arrow?
My best guess is you have a StatusStrip on the form. If so, set the SizingGrip property to false.
What you are looking for is:
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
or it can be set in form designer property window.
Correction:
On the form, setting the Border to Fixed3D will remove the sizing grip from the form... UNLESS you have a status strip on the form with a SizingGrip set to true.
Solution: insure that your form's statusStrip1.SizingGrip = false;
See: http://msdn.microsoft.com/en-us/library/system.windows.forms.form.sizegripstyle.aspx
there should be a property of the form called ShowSizeGrip, just set it to False.

Categories