Form.ShowInTaskbar Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value indicating whether the form is displayed in the Windows taskbar.
public:
property bool ShowInTaskbar { bool get(); void set(bool value); };
public bool ShowInTaskbar { get; set; }
member this.ShowInTaskbar : bool with get, set
Public Property ShowInTaskbar As Boolean
true
to display the form in the Windows taskbar at run time; otherwise, false
. The default is true
.
The following example demonstrates how to use the ShowInTaskbar property to make a dialog box that is not displayed in the Windows taskbar.
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();
}
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();
}
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
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.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: