Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Minimising a form

Status
Not open for further replies.

rache1

Programmer
Mar 20, 2001
9
TW

Hi all,
may I know which form method do I use if I want to do some coding if the minimise button is clicked?

I want to hide the form if the minimise button on the form is clicked, and does not show in the task bar when minimised.

Thank you. :p



 
I've not tested this, but it might work...

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...

Hope that helps...

Martin
 
Thanks Martin.

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. :p

Rachel >.<
 
Ah - okay...

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 &quot;reshow&quot; it...

Martin.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top