Right click window - how to close it

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Henri.Chinasque@googlemail.com

    Right click window - how to close it

    Hi all,

    I've made a control, and when a user right clicks it, it launches a
    form with some options. I want this form to behave like typical "right
    click" windows do - it should close when the user clicks a location
    not on the form. The trouble is that I can only pick up clicks that
    occur ON the form, so I'm at a loss as how to close it.

    Any ideas?

    thanks,
    HC
  • Alberto Poblacion

    #2
    Re: Right click window - how to close it

    <Henri.Chinasqu e@googlemail.co mwrote in message
    news:1b758013-efd3-4234-9991-8765ba9f5a20@p4 9g2000hsd.googl egroups.com...
    I've made a control, and when a user right clicks it, it launches a
    form with some options. I want this form to behave like typical "right
    click" windows do - it should close when the user clicks a location
    not on the form. The trouble is that I can only pick up clicks that
    occur ON the form, so I'm at a loss as how to close it.
    >
    Any ideas?

    You can use the Deactivate event of the form. which occurs when the form
    loses focus and is no longer the active form. This will hapen if the user
    clicks outside of the form.

    Comment

    Working...