Avatar of RIAS
RIAS
Flag for United Kingdom of Great Britain and Northern Ireland asked on

How to remove icon from title bar

Hello,

I have an icon that I want to display in the taskbar; however, I don't want this icon to display in the title bar. I tried setting ShowIcon to false, but that hides my icon in both the title bar and the task bar. Is there any way to only hide it in the title bar?
i am using vb.net 2015 desktop
.NET ProgrammingVisual Basic.NET

Avatar of undefined
Last Comment
RIAS

8/22/2022 - Mon
Ryan Chong

your existing setting should be correct >> ShowIcon to false

then try go to project properties and change the icon there accordingly?
SnapShot.png
AndyAinscow

Try making different sized (32x32 and 16x16) icons for the app.  The smaller one (title bar?) being blank.
Ryan Chong

disregard my comment above, it seems doesn't work.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
RIAS

ASKER
Try making different sized (32x32 and 16x16) icons for the app.  The smaller one (title bar?) being blank.

Where to set these icons ?
AndyAinscow

I get both sizes created automatically when I add an icon to the project:

SNAG-0012.bmp
RIAS

ASKER
There is no option to choose icons for title and taskbar in visual studio 2015
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
AndyAinscow

Odd.  I don't have VS 2015 to test but there ought to be a way to customise the icon for the app.
RIAS

ASKER
Not sure how to set icons for taskbar and titlebar
AndyAinscow

In the form load event
        Me.Icon = My.Resources.Icon1
where Icon1 is the name of your custom icon.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
RIAS

ASKER
Andy but this option is for both title bar and taskbar.Dont know how to set differently for titlebar and taskbar?
SOLUTION
AndyAinscow

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
RIAS

ASKER
So to brief it ; Andy need to have two icons with same name.My question is how does the vb.net app know which icon to use for titlebar and taskbar.Cannot see any settings for doing that.
AndyAinscow

The system chooses the icon automatically based on how big the icon is and how big is the icon to be displayed.  The title bar being much smaller than the task bar means (in general) the 16x16 icon will be used for the title bar and the 32x32 will be used for the task bar.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
RIAS

ASKER
Cheers Andy!
it_saige

ShowIcon and ShowInTaskbar are properties of the form, not the project.Capture.JPGSetting ShowIcon to false instructs the form not to display the icon on the caption (or title) bar.  Setting ShowInTaskbar instructs the form not to display on the Windows taskbar.

-saige-
RIAS

ASKER
-saige-,
Can it be viceversa

Showicon in taskbar and not in title bar
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
it_saige

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
RIAS

ASKER
Hello,
Thanks, will go for the second method and get back
AndyAinscow

If you look very carefully the code from it_saige  (for setting an icon) is just doing what I suggested in a more indirect way.  (It can be useful for you if you needed to make other windows API calls)

Is there a problem with what I suggested?  Here it will work in the fashion you described with one line of code.
RIAS

ASKER
Yes Andy , both the experts made it very clear to understand.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
RIAS

ASKER
Saige as usual thorough description and clarity in your solution. Thank you Sir.