ant2009
ant2009

Reputation: 22486

C# 2005: Remove icon from the form's title bar

A client has asked me to remove the icon from the form's title bar. As they don't want to display any icon. But this me guessing as when I click on the icon property you have to browse to some icon.

Upvotes: 30

Views: 44007

Answers (7)

Momoro
Momoro

Reputation: 617

Icon  >  False

This COULD be a good approach, but these are good too:

this.Icon = null;

//Or

FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog

//Or

Select Your Form -> Right-Click -> Properties -> Icon -> Select file

That's all I have for this, I hope this helps you.

Upvotes: 1

Aqeel
Aqeel

Reputation: 971

You can also try this:

this.Icon = null;

Upvotes: 2

tmsdajpa
tmsdajpa

Reputation: 62

There appears to be an updated process. Following the steps in the selected answer doesn't direct me to an option to upload an icon. That option can be found on Microsoft's site: https://support.office.com/en-us/article/add-a-custom-title-or-icon-to-a-database-0e43e135-dd0d-4451-84ea-4f547e14480e

Upvotes: 2

yinyueyouge
yinyueyouge

Reputation: 3754

There are two ways.

First is to create an empty Icon file and then Select Form -> Right Click -> Goto Properties -> Goto Icon -> Select your file.

The other approach is to set FormBorderStyle of the form to FormBorderStyle.SizableToolWindow or FormBorderStyle.FixedToolWind

And one more way is to set ShowIcon property to be false.

Upvotes: 11

Stanislav Kniazev
Stanislav Kniazev

Reputation: 5488

Set ShowIcon Property of the form to False to see if that's what your client wants.

Upvotes: 77

Fredrik Mörk
Fredrik Mörk

Reputation: 158289

You can set ControlBox = false. However, that will remove not only the icon but also maximize and minimize buttons from the title bar.

Upvotes: 2

Ramesh Soni
Ramesh Soni

Reputation: 16077

Set

FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog

Upvotes: 4

Related Questions