Click here to Skip to main content
15,885,985 members
Articles / Programming Languages / C#
Tip/Trick

Hiding the Control Box in Windows Application

Rate me:
Please Sign up or sign in to vote.
3.89/5 (6 votes)
10 Apr 2014CPOL1 min read 12.6K   5   1
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)


Written By
Software Developer (Senior) CyberQ
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 1 Pin
Kseg9715-Apr-14 18:00
Kseg9715-Apr-14 18:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.