I am making an application which will have an interface similar to Photoshop: multiple separate forms all help edit an object. So, i'll have multiple forms, one of which is "main" (provides file menu, settings menu, about etc) and others have controls that edit the object opened in main form.
Lets say for simplicity this is a text editor and i have MainForm and StyleForm. Now, what i need is for the whole application to show as one "bar" in the windows taskbar. This could be achieved by setting ShowInTaskbar to false for StyleForm, but then if i, say, focus other application, then focus my application, only MainForm will get on top of other windows, StyleForm will remain hidden under the window of the application i focused previously.
I found answer here Make all forms associated with a program come to the front when one form is selected but it imports a dll. Maybe there is a .net solution for this?
Also, i'd like to display something different in the taskbar, not the MainForm's caption, is that possible?
Best Answer
I set the second form to
ShowInTaskBar = false
, set theFormBorderStyle
toSizableToolWindow
and then created it using the following code:This makes the subform
F2
stay on top ofForm1
and hides and shows it when theForm1
is hidden and shown.EDIT
Oh, I used Visual Studio 2010 and .NET 4 Client Profile if that's important. This should work with other versions, however.