How can I remove the blue border that's on top of the Window Form? (I don't know the name of it exactly.)
7 Answers
You can set the Property FormBorderStyle
to none in the designer,
or in code:
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-
Unfortunately there is a problem on Windows 10(at least on some builds) with `FormBorderStyle.None` on [**form resize**](https://stackoverflow.com/q/51824224/7713750). – Rekshino Aug 14 '18 at 14:26
-
This works when the WindowState of form is Normal not when it is Maximized. – S. B. Aug 25 '22 at 09:00
if by Blue Border thats on top of the Window Form
you mean titlebar, set Forms ControlBox
property to false
and Text
property to empty string ("").
here's a snippet:
this.ControlBox = false;
this.Text = String.Empty;

- 2,374
- 1
- 17
- 18
-
12Your solution have the advantage over setting border style to None, because... it leaves the border intact :) +1 – Spook Jul 31 '13 at 19:27
-
And somehow, if you do it via `FormBorderStyle.None` it disables you from drawing on the form somehow (OnPaint sets an image in a picturebox that has its `Dock` set to `Fill`), worked fine until I changed the border setting with `FormBorderStyle.None`, but this way, drawing still works for me :) – DrCopyPaste Mar 10 '14 at 14:31
-
@JohnNguyen not working? that's odd, are you sure you have implemented it correctly? – Nika G. Jan 29 '15 at 06:33
-
@NikoG. I implemented it correctly. the title bar is still appear. I cannot add images at here to show you. the title have no control, no title but it's not disappear. – John Nguyen Jan 29 '15 at 06:37
-
-
5This solution seems to look really bad in Windows 10 - the "hidden" title bar does not completely disappear - leaving a "bump" on the top of the window. I assume this is caused by the Windows 10 thin window borders. I haven't found a way around this. Looks like I'm stuck going the **FormBorderStyle.None** route. – Fool Running May 08 '18 at 15:31
-
@FoolRunning This Solution is good also for Win10, where with `FormBorderStyle.None` there is a problem on [**resize**](https://stackoverflow.com/q/51824224/7713750)! Just set `FormBorderStyle` to the **`FixedToolWindow`** or **`FixedSingle`**. – Rekshino Aug 14 '18 at 14:21
-
-
2setting the FormBorderStyle to Sizable with the above suggestion works, but be warned that windows 10 adds an unsightly bar at the top of the window outside the client rectangle which appears to be the grab-area/resize-border for resizing the window vertically (it seems the top border is rendered inside the visible form border and the others are rendered outside o_O). – fusi Nov 04 '19 at 14:34
-
I have tested it in Windows 11 and the caption bar(title bar) is not hidden by setting ControlBox to false.It only hides the minimize, maximize and close buttons in the upper-right corner. If you want a borderless window with no maximize, minimize and close buttons and without caption bar, you will need to set FormsBorderStyle property to none.But be aware of that because doing so then you will not be able to drag the window,you lose this feature.Also as told here in other comments and answers,in this case you will need to manually implement the dragging and close functionalities by yourself. – Willy Nov 10 '22 at 22:07
Also add this bit of code to your form to allow it to be draggable still.
Just add it right before the constructor (the method that calls InitializeComponent()
private const int WM_NCHITTEST = 0x84;
private const int HTCLIENT = 0x1;
private const int HTCAPTION = 0x2;
///
/// Handling the window messages
///
protected override void WndProc(ref Message message)
{
base.WndProc(ref message);
if (message.Msg == WM_NCHITTEST && (int)message.Result == HTCLIENT)
message.Result = (IntPtr)HTCAPTION;
}
That code is from: https://jachman.wordpress.com/2006/06/08/enhanced-drag-and-move-winforms-without-having-a-titlebar/
Now to get rid of the title bar but still have a border combine the code from the other response:
this.ControlBox = false;
this.Text = String.Empty;
with this line:
this.FormBorderStyle = FormBorderStyle.FixedSingle;
Put those 3 lines of code into the form's OnLoad event and you should have a nice 'floating' form that is draggable with a thin border (use FormBorderStyle.None if you want no border).

- 1,021
- 10
- 5
-
This option makes window sizable. Much better than setting FormBorderStyle to None. Just what I wanted. – Antonio Rodríguez Jul 24 '19 at 09:58
-
1hi @AntonioRodríguez, how can you resize this form? I have a normal form, and put this in Load event, it shown a single line border + no title bar form, but can't resize (I'm on windows 10) this.ControlBox = false; this.Text = String.Empty; this.FormBorderStyle = FormBorderStyle.FixedSingle; – haiduong87 Dec 15 '19 at 07:03
-
Good solution, works fine on windows 10 and 11. Tks man – Rafael Alfredo Zelaya Amaya Oct 21 '22 at 20:25
Set FormsBorderStyle
of the Form to None
.
If you do, it's up to you how to implement the dragging and closing functionality of the window.

- 10,303
- 17
- 74
- 174
-
There is no way to maintain a sizable form with no border and not have that annoying little bit of title bar at the top. Even using Win32 directly won't get rid of it. If you have no border you have to implement your own methods for close, maximise, minimise which are easy enough. Implementing sizeable though is a right pain to be foolproof. I tried but eventually gave up, its a lot of work for not much gain. – djack109 Mar 28 '20 at 18:13
I am sharing my code. form1.cs:-
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace BorderExp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
}
private void ExitClick(object sender, EventArgs e)
{
Application.Exit();
}
private void MaxClick(object sender, EventArgs e)
{
if (WindowState ==FormWindowState.Normal)
{
this.WindowState = FormWindowState.Maximized;
}
else
{
this.WindowState = FormWindowState.Normal;
}
}
private void MinClick(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
}
}
}
Now, the designer:-
namespace BorderExp
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button1.BackColor = System.Drawing.SystemColors.ButtonFace;
this.button1.BackgroundImage = global::BorderExp.Properties.Resources.blank_1_;
this.button1.FlatAppearance.BorderSize = 0;
this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Location = new System.Drawing.Point(376, 1);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(27, 26);
this.button1.TabIndex = 0;
this.button1.Text = "X";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.ExitClick);
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button2.BackColor = System.Drawing.SystemColors.ButtonFace;
this.button2.BackgroundImage = global::BorderExp.Properties.Resources.blank_1_;
this.button2.FlatAppearance.BorderSize = 0;
this.button2.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button2.Location = new System.Drawing.Point(343, 1);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(27, 26);
this.button2.TabIndex = 1;
this.button2.Text = "[]";
this.button2.UseVisualStyleBackColor = false;
this.button2.Click += new System.EventHandler(this.MaxClick);
//
// button3
//
this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button3.BackColor = System.Drawing.SystemColors.ButtonFace;
this.button3.BackgroundImage = global::BorderExp.Properties.Resources.blank_1_;
this.button3.FlatAppearance.BorderSize = 0;
this.button3.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button3.Location = new System.Drawing.Point(310, 1);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(27, 26);
this.button3.TabIndex = 2;
this.button3.Text = "___";
this.button3.UseVisualStyleBackColor = false;
this.button3.Click += new System.EventHandler(this.MinClick);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = global::BorderExp.Properties.Resources.blank_1_;
this.ClientSize = new System.Drawing.Size(403, 320);
this.ControlBox = false;
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
}
}
the screenshot:- NoBorderForm

- 20,585
- 22
- 95
- 108