Telerik RadWindow icon not displayed on task bar c# wpf [duplicate]

左心房为你撑大大i 提交于 2019-12-08 05:17:48

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!