Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6854855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:41:08+00:00 2026-05-27T01:41:08+00:00

I have a simple application. When you click a button, the tasbar icon changes.

  • 0

I have a simple application. When you click a button, the tasbar icon changes. When I Run this app from visual studio, everything works fine, but when I publish the WPF app, the taskbar Icon does not work (there is none).

The build action is set to “embedded resource/copy always”, I have tested “Resource” as well but it doesn’t work.

var iconUri = new Uri("pack://application:,,,/images/internet_connection.ico", UriKind.RelativeOrAbsolute);
        this.Icon = BitmapFrame.Create(iconUri);

the icon in the top left corner of the frame changes, but the one in the taskbar doesn’t.

Can anyone help me please ?

@Edit,

I got it to work thanks to @Pavel’s comment. But now one problem remains:

When I run it in visual studio, and I do this:

var iconUri = UriHelper.GetUri(this.GetType(), "images/local_network.ico");
        this.Icon = BitmapFrame.Create(iconUri);

The Icon changes. But with the published version, it doens’t change.

@@Edit,

Ok so this is my code when I press a button:

  var iconUri = UriHelper.GetUri(this.GetType(), "images/internet_connection.ico");
        this.Icon = BitmapFrame.Create(iconUri);
        mNotifyIcon = new NotifyIcon
        {
            BalloonTipText = "The app has been minimised. Click the tray icon to show.",
            BalloonTipTitle = "The App",
            Text = "The App",
            Icon = BitmapFrame.Create(iconUri)
        };

        BitmapImage image = new BitmapImage();
        image.BeginInit();
        image.UriSource = UriHelper.GetUri(this.GetType(), "images/internet_connection.png");
        image.EndInit();
        TaskbarItemInfo = new System.Windows.Shell.TaskbarItemInfo() { Overlay = image };

what does it do:
When running from VS: the icon in the taskbar changes, the overlay works, the icon in the top corner of the application changes.

After build running the exe: the icon in the taskbar DOES NOT change, the overlay works, the icon in the top corner of the application changes.

Can anyone explain this ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:41:09+00:00Added an answer on May 27, 2026 at 1:41 am

    i think this line works for you (you have forgot the …;component/….):

    var iconUri = new Uri("pack://application:,,,/YourProjectName;component/images/internet_connection.ico", UriKind.RelativeOrAbsolute);
    

    for the icon use

    Build Action = Resource
    Copy to OutputDirectory = Do not copy
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple application that contains one button to be clicked in order
I have simple JSF application. Everything works fine, but not navigation. It behaves like
HI, I have simple application which copy text from a textbox and paste it
I have a simple html application which displays words on a click of a
I have created a simple silverlight application to display some text at realtime from
Need to provide this facility on a button-click in my web application. Could be
I have a simple WPF application with a button whose tooltip is binded to
I have a simple application that has a single page with a button that
I have simple WinForms application where modifying Windows Registry. The problem is that in
I have a simple application with the following code: FileInfo[] files = (new DirectoryInfo(initialDirectory)).GetFiles();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.