Windows API Code Pack TaskDialog missing icon

前端 未结 2 904
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-21 06:58

The icons in my TaskDialog are missing:

\"\"

And in the taskbar:

相关标签:
2条回答
  • 2021-01-21 07:43

    I'd add this as a comment but I don't have enough rep. The marked answer worked for me once I removed this line of code:

        taskDialog.FooterIcon = taskDialog.FooterIcon;
    

    It was causing an unhandled exception.

    0 讨论(0)
  • 2021-01-21 07:50

    I've found a workaround to this. Apparently it is a bug in the API itself.

    taskDialog.Opened += new EventHandler(taskDialog_Opened);
    
    ...
    
    public void taskDialog_Opened(object sender, EventArgs e)
    {
        TaskDialog taskDialog = sender as TaskDialog;
        taskDialog.Icon = taskDialog.Icon;
        taskDialog.FooterIcon = taskDialog.FooterIcon;
        taskDialog.InstructionText = taskDialog.InstructionText;
    }
    
    0 讨论(0)
提交回复
热议问题