Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C#

Hiding the Control Box in Windows Application

3.89/5 (6 votes)
10 Apr 2014CPOL1 min read 12.9K  
Hiding the control box like minimize, maximize, close button in Windows application

Introduction

In this tip, I will show how you can hide the control box like minimize, maximize, close button and change the look feel of your windows application form.

You can change the look and feel of login form in Windows application by the hiding of minimize, maximize, close button.

To change the look and feel, follow the steps given below.

Step 1: Create a Windows application named ‘Windows App’.

Image 1

Step 2: Add a label and change the text like name of your application in your default form named ‘Form1’.

Image 2

Add some more functionality like

  • Add some controls like button, label, textbox and groupbox
  • Change the background color of form via properties->background color

    Image 3

Step 3: Run the application

Image 4

Purpose

Hide the control box like minimize, maximize, close button and change the look and feel of the form.

Solution

  1. Change the ‘FormBorderStyle’ property of the form as ‘None’ instead of default value ‘sizable’.

    Image 5

  2. Run the application and see the form.

    Image 6

  3. But here is a drawback like how to close the application if user wants, so you have to add close button for closing on the form.

    Image 7

  4. Call the close() method on click event of the close button to close the form.
    C#
    private void button2_Click(object sender, EventArgs e)
    {
        Close();
    } 

    Image 8

  5. Run the application and check it.

    Image 9

License

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