Set an event for "Resize" on the Form, and in that event, check the value of the form's "state" property to see if the form is minimised. If it is, set it's ShowInTaskBar property to false.
Why do you want to hide the form? If it's just because you don't want to entertain minimising and wish the button to act as a close, just set "MaxButton" and "MinButton" to false - leaving only the close button in situe... There's a property for whether or not you wish to display the window control menu in the left hand side of the titlebar as well... I mention it because Maximise etc can be called from there as well...
I wanted to hide the form because I want it to run in the background to do some status tracking. When the user click on another command in another form, this form will "resurface" again, showing the status. Hence I want to hide it and the user will not have too many taskbar icons lying around.
In that case, use the tests I described above, and use the Hide method to hide the form. I *Think* it should continue processing when hidden - but be aware that the activate event will be triggered again when you "reshow" it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.