I have a parent form. When i click a button, a modal child form appeare within the form and is located at the center of the parent form :
but the problem is in the taskbar, the application have 2 instances :
How do i prevent this second instance or Hide it from the taskbar ? Thanks !
When you instantiate the second form, set the ShowInTaskbar
property to False
to prevent it from showing up in the Windows task bar.
You don't show the code where you instantiate and display the form, but something like this should work:
var secondForm = new Form2
{
ShowInTaskbar = false,
StartPosition = FormStartPosition.CenterParent
};
secondForm.ShowDialog();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.