views:

329

answers:

1

i would like my form to dissappear when the user clicks outside the form in vb.net. how do i do this?

+4  A: 

What about responding to the Form.Deactivate event?

Eric
i am having a problem with this. for some reason when i deactivate the form, clicks are not registered at all anywhere except for the taskbar
I__
You shouldn't have to deactivate the form yourself. This event should be raised automatically when the user clicks outside the form. It should be sufficient to do something like Me.Hide() in response to this event.
Eric
i tried me.hide and tried minimize, i am having the same problem where clicks are completely ignored by my computer
I__
The problem lies elsewhere then. Try making a new WinForms application with a single form whose only behavior is to hide when Form.Deactivate is raised.
Eric