简体   繁体   中英

Why is the incorrect icon being displayed?

Why is the incorrect icon being displayed?

Steps taken:

1) right click on project => Properties => Application (left menu) => Resources (group box) => Icon and manifest (radio button)=> browse to \\Resources ... select the IconHome.ico file that was created.

2) modify xaml code

<Window x:Class="HomeDb.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Home" Icon="IconHome.ico">

The icon displayed is not the "16x16 4 bit". The icon displayed is similar to the "16x16 8 bit".

I also noticed that viewing the icon with Windows Explorer, the icon does not look as created, unless I open the .ico file. Then it displays properly. Is this something with Windows 7?

Wow. This is really subtle.

There are "32x32 8 bit", "16x16 8 bit", "32x32 32 bit", and "16x16 32 bit" icons displayed below my other icons.

I had to:

1) to delete those extra icons ... right click => delete image type.

2) rename the icon (required by Visual Studio).

3) right click on project => Properties => Application (left menu) => Resources (group box) => Icon and manifest (radio button)=> browse to \\Resources ... select the IconHomeNew.ico file that was created.

4) modify xaml code

<Window x:Class="HomeDb.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Home" Icon="IconHomeNew.ico">

5) rename IconHome.ico to IconHomeNew.ico in Resources.resx.

It works now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM