J. Newerest
J. Newerest

Reputation: 25

Is that possible to remove a little windows that showing a form name when ShowInTaskbar = false?

I have a main form (which I need to show in the taskbar) and a few additional forms which I don't want to be shown in the taskbar. When I'm setting ShowInTaskbar property to false for my additional forms, after minimizing I can see little windows with form names as shown below in the screenshot. So the question is: how to remove that little nasty windows?

Screenshot: enter image description here

Upvotes: 1

Views: 141

Answers (1)

Jeff R.
Jeff R.

Reputation: 1521

If you "Minimize" the window, it has to go somewhere - either the Taskbar or the desktop. You can set the MinimizeBox property to False and that will prevent it from minimizing to the desktop or at all.

I think what you really want to do is hide the form. And if you still want the user to have the ability to "Minimize" the form (or at least think they do) you can subscribe to the form's Resize event and check the WindowState. If the WindowState is Minimized, set it back to Normal and call the form's Hide method.

private void LoadedDataForm_Resize (object sender, EventArgs e)
{
    if (this.WindowState == FormWindowState.Minimized) {
        this.WindowState = FormWindowState.Normal;
        this.Hide ();
    }
}

Upvotes: 2

Related Questions