Click here to Skip to main content
11,576,060 members (53,947 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
How to Complete remove the Exit button from the title bar in windows form in C#



Any Suggestion
Posted 2-Nov-12 18:34pm
Comments
GeekBond at 3-Nov-12 12:47pm
   
Take a look at the ControlBox property of form in design view and set it to false.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Setting FormBorderStyle = "none" will remove the title bar (at both design and run time) - and also remove your ability to resize the form.

If you need a border you can set:

ControlBox = "false";
Text = "";
And if you want to disable the close button then try this:
Disable An Applications Close Button[^]


     --Amit
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

http://msdn.microsoft.com/en-us/library/system.windows.forms.form.controlbox.aspx[^]

public void CreateMyBorderlessWindow()
 {
    this.FormBorderStyle = FormBorderStyle.None;
    this.MaximizeBox = false;
    this.MinimizeBox = false;
    this.StartPosition = FormStartPosition.CenterScreen;
    // Remove the control box so the form will only display client area.
    this.ControlBox = false;
 }
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

There is no such button on a title bar. There is nothing to remove.

—SA
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 335
1 F-ES Sitecore 145
2 OriginalGriff 125
3 Abhinav S 98
4 Dave Kreskowiak 80
0 OriginalGriff 705
1 Sergey Alexandrovich Kryukov 630
2 Abhinav S 438
3 F-ES Sitecore 410
4 Suvendu Shekhar Giri 365


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 8 Jul 2013
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