Search code examples
c#winformstaskbar

c# taskbar button switching/moving in multiple display environment


I've created a winforms application. All is running fine, also the taskbar button is created and shown in taskbar including the correct icon.

Whenever I move the form from one display to the second display, the taskbar button stays at the display from where the form was initial start.

I also compared the settings with another winforms application where the behaviour is correct. Means, the button is moving/switching/whatever to the active display where the form is moved to.

Hopefully it is just a small thing, but I came not across with it.


Solution

  • It is an OS feature.

    • For windows 7 there is no built-in support to show taskbar for your second monitor and your taskbar buttons will always show on first monitor taskbar.
    • For windows 8 you can open Taskbar properties and in Multiple displays settings, check Show taskbar on all displays and then set the value of Show taskbar bottons on: to Taskbar where window is open