1

I have created one application using c# wpf. I have set the application icon from the properties->Application,but some how application icon not displayed on taskbar.the application is running but nothing displayed on the taskbar. I can operate application properly.

I not getting what is wrong

Youngjae
  • 24,352
  • 18
  • 113
  • 198
Neha
  • 184
  • 12
  • Ideally setting an icon file for the application from Property works. So I am not sure why its not happening for you. Try and launch the application from Windows Explorer instead of running it from Visual Studio or rebuild the icon cache. – sudarsanyes Aug 27 '14 at 11:46
  • To duplicate marker; this question is wrongly marked. It's not about `Window`, but about `RadWindow` from Telerik product. – Youngjae Mar 03 '18 at 06:26

3 Answers3

2

Hey you can try this out

    private void MainWindow_Loaded(object sender, RoutedEventArgs e)
    {
        Window window = (sender as RadWindow).ParentOfType<Window>();            
        if (window != null)
        {
            window.ShowInTaskbar = true;
            window.Icon = BitmapFrame.Create(new Uri("pack://application:,,,/Screener;Component/Images/Screener1.ico", UriKind.RelativeOrAbsolute));
        }
        throw new NotImplementedException();
    }
Pranjal Kothari
  • 88
  • 1
  • 10
0

The taskbar is showing the icon of the active window. Set the icon of the active window.

nvoigt
  • 75,013
  • 26
  • 93
  • 142
0

The icon that you have set in the Application tab of the project Properties Window is the icon that will be applied to the project assembly file. If you look into your project's bin folder, you should see your icon on the executable file.

If you want to set an icon to appear in the title bar of your running application, then you need to set the Window.Icon Property in the MainWindow.xaml file.

<Window x:Class="Midas.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Icon="FolderName/IconName.ico">
    ...
</Window>
Sheridan
  • 68,826
  • 24
  • 143
  • 183