问题
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
回答1:
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();
}
回答2:
The taskbar is showing the icon of the active window. Set the icon of the active window.
回答3:
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>
来源:https://stackoverflow.com/questions/25523357/telerik-radwindow-icon-not-displayed-on-task-bar-c-sharp-wpf