Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 4
Form Class
Form Properties
 ShowInTaskbar Property
Collapse All/Expand All Collapse All
.NET Framework Class Library
Form..::.ShowInTaskbar Property

Gets or sets a value indicating whether the form is displayed in the Windows taskbar.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)
Visual Basic
Public Property ShowInTaskbar As Boolean
C#
public bool ShowInTaskbar { get; set; }
Visual C++
public:
property bool ShowInTaskbar {
    bool get ();
    void set (bool value);
}
F#
member ShowInTaskbar : bool with get, set

Property Value

Type: System..::.Boolean
true to display the form in the Windows taskbar at run time; otherwise, false. The default is true.

If a form is parented within another form, the parented form is not displayed in the Windows taskbar.

You can use this property to prevent users from selecting your form through the Windows taskbar. For example, if you display a Find and Replace tool window in your application, you might want to prevent that window from being selected through the Windows taskbar because you would need both the application's main window and the Find and Replace tool window displayed in order to process searches appropriately.

You will often wish to use this property when creating a form with the FixedToolWindow style. Setting the FixedToolWindow style does not alone guarantee that a window will not appear in the taskbar.

The following code example demonstrates how to use the ShowInTaskbar property to make a dialog box that is not displayed in the Windows taskbar.

Visual Basic
Private Sub ShowInTaskBarEx()
    Dim myForm As New Form()
    myForm.Text = "My Form"
    myForm.SetBounds(10, 10, 200, 200)
    myForm.FormBorderStyle = FormBorderStyle.FixedDialog
    myForm.MinimizeBox = False
    myForm.MaximizeBox = False
    ' Do not allow form to be displayed in taskbar.
    myForm.ShowInTaskbar = False
    myForm.ShowDialog()
End Sub
C#
        private void ShowInTaskBarEx()
        {
            Form myForm = new Form();
            myForm.Text = "My Form";
            myForm.SetBounds(10,10,200,200);
            myForm.FormBorderStyle = FormBorderStyle.FixedDialog;
            myForm.MinimizeBox = false;
            myForm.MaximizeBox = false;
            // Do not allow form to be displayed in taskbar.
            myForm.ShowInTaskbar = false;
            myForm.ShowDialog();
        }
Visual C++
private:
   void ShowInTaskBarEx()
   {
      Form^ myForm = gcnew Form;
      myForm->Text = "My Form";
      myForm->SetBounds( 10, 10, 200, 200 );
      myForm->FormBorderStyle = ::FormBorderStyle::FixedDialog;
      myForm->MinimizeBox = false;
      myForm->MaximizeBox = false;

      // Do not allow form to be displayed in taskbar.
      myForm->ShowInTaskbar = false;
      myForm->ShowDialog();
   }

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Fun fact: Setting ShowInTaskbar = false after ShowDialog() makes Form disappear      dpuza   |   Edit   |   Show History
$0 $0$0 $0$0 $0
var f = new Form();

// form does not disappear if ShowInTaskbar is set before call to ShowDialog()
//f.ShowInTaskbar = false;

var button = new Button();

// click button makes form disappear, if ShowInTaskbar changes from true to false
// button.Click += new EventHandler((a, b) => f.ShowInTaskbar = false);

f.Controls.Add(button);

// form disappears on load, if ShowInTaskbar changes from true to false
//f.Load += new EventHandler((a,b) => f.ShowInTaskbar = false);

f.ShowDialog();
$0
$0$0 $0 $0$0 $0 $0https://connect.microsoft.com/VisualStudio/feedback/details/176985/showintaskbar-true-at-load-event-and-show-form-by-using-showdialog-then-form-closed-immediately?wa=wsignin1.0$0 $0 $0$0 $0 $0http://stackoverflow.com/questions/2390945/how-to-change-this-showintaskbar-for-a-form-showdialog-while-keeping-it-op$0 $0 $0$0 $0
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker