Call Application.Minimize
and Application.Restore
to perform these actions.
To remove a form from the taskbar, hide it. Assuming that you have Application.MainFormOnTaskbar
set to True
, and only the main form associated with the taskbar, you can use Application.MainForm.Visible := False
. Reverse this when you call Application.Restore
.
So, in summary, to go dark:
Application.Minimize;
Application.MainForm.Visible := False;
And to reappear:
Application.MainForm.Visible := True;
Application.Restore;
If you have more than one form associated with the taskbar, you'd need to hide those forms too to remove the button from the task bar.