Tom
Tom

Reputation: 6697

How to prevent Taskbar button disappearing when form is hidden

How to prevent Taskbar button disappearing when the only form of application is hidden?

My application has one always on top form, but sometimes I need to hide it, but still keep Taskbar button visible. Taskbar button is used to control the product.

Upvotes: 1

Views: 958

Answers (2)

SilverWarior
SilverWarior

Reputation: 8376

Or if you wanna avoid minimization/maximization effects by minimizing/maximizing form use Alpha transparency and set it to 0 (fully transparent) instead.
This way you hide the window from users sight, but from the OS side the window is still visible so it will maintain its Taskbar button.

Upvotes: 4

David Heffernan
David Heffernan

Reputation: 613163

Taskbar buttons are not shown for hidden windows. So, if the taskbar button is associated with your main form's window, and you hide that form, then the taskbar button will be hidden.

So, I guess the easiest thing to do would be to stop hiding the main form. Use Application.Minimize, or WindowState := wsMinimized instead.

Upvotes: 3

Related Questions