Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple windows, but also multiple items on the task bar

Tags:

wpf

taskbar

I'm setting up a program that has three different windows. I'm just using ..

Window1 win1 = new Window1(); win1.show();

...for each of the extra windows. The problem is that each window opens up a new tab on the taskbar. Is there anyway that I can still have my three windows with only one related item on the taskbar?

If possible, I would not like to make them all child forms and have to sit inside of another box.

Thank you

like image 370
Califer Avatar asked Sep 07 '09 04:09

Califer


2 Answers

Set the ShowInTaskbar to false

<Window ShowInTaskbar="False" ... />

If you want to make the windows related together, like when you click one of them it brings them all, set the Owner before showing the window (assuming this is your main window)

Window1 w = new Window1();
w.Owner = this;
like image 133
Pierre-Alain Vigeant Avatar answered Sep 21 '22 15:09

Pierre-Alain Vigeant


Set the "secondary" windows' ShowInTaskbar property to false. Also it wouldn't hurt to set their Owner property to App.Current.MainWindow, so that the all the windows close (and hence the application exits) when the main window is closed.

like image 36
Matt Hamilton Avatar answered Sep 22 '22 15:09

Matt Hamilton