Set a taskbar text different from the Window title in wpf

后端 未结 3 1992
隐瞒了意图╮
隐瞒了意图╮ 2020-12-11 15:53

I develop with VS2010 in C# and I would like to create a WPF Window which have a taskbar text different from the Window title. The property Title set both the window title a

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-11 16:12

    Basically, you have two options:

    1. Draw the taskbar button yourself, rather than letting Windows handle it. This is actually reasonably simple, as far as owner drawing things goes.

    2. Manage two different forms/windows simultaneously. You'll need to create a hidden main window that will appear on the taskbar and own your second window. Your second window will be visible, display its own caption on its title bar, and contain your actual user interface, but won't show up on the taskbar (set its ShowInTaskbar property to "False"). You'll have to write code to show the second window whenever the first one is activated using the taskbar.

    I recommend that before starting down either one of these paths, you carefully consider whether you really need this "functionality". It's difficult to tell what goes with what if you have what is effectively one window with different names in different places.

提交回复
热议问题