Abd ul rahaman Shalata
Abd ul rahaman Shalata

Reputation: 154

Show in TaskBar C#

I want to see from when I click on Alt + tab ,I set showtaskbar = true but nothing happened I call the form by this code

  childForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            childForm.MaximizeBox = false;
            childForm.MinimizeBox = false;
            childForm.StartPosition = FormStartPosition.Manual;
            childForm.ControlBox = false;
            childForm.MdiParent = MdiParent;
            childForm.ShowInTaskbar = true;
            childForm.ShowIcon = true;
            childForm.Location = new Point(Screen.PrimaryScreen.Bounds.Width - 1360, 5);
            childForm.Show();

Upvotes: 0

Views: 1166

Answers (1)

Cee McSharpface
Cee McSharpface

Reputation: 8726

This is behavior by design.

quoting from https://msdn.microsoft.com/en-us/library/system.windows.forms.form.showintaskbar.aspx:

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

If you need multiple windows of one application shown in the taskbar, don't use MdiParent/MdiChild.

There is a hack which may work for you, but it is likely not sustainable (may break in future versions of Windows).

Upvotes: 1

Related Questions