By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,460 Members | 1,508 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,460 IT Pros & Developers. It's quick & easy.

Get mouse global clicks without a hook

P: n/a
Hi Everyone,

I'm writing a color picker control (combobox looking control, wonder why
..Net does not come with this control). It's a Button derived class that
when clicked, opens a form (without a title bar) just below it and displays
some "push like" colored radio buttons in it. I need to detect when the
user clicks anywhere outside the popup window so that I can close it.

Setting Form.Capture to true won't help since the user won't be able to
click on the radio buttons.

I don't want to set a Windows hook, since that would tie the control to the
windows API.

I'm looking for a .Net way of doing this without directly tapping into the
API.

I would appreciate any suggestion.

Thanks
AliR.
Jun 28 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I found the answer: ToolStripDropDown does the job beautifully.

Here is an article on how to get it done:
http://www.codeproject.com/KB/miscctrl/simplepopup.aspx

AliR.
"AliR (VC++ MVP)" <Al**@online.nospamwrote in message
news:Gf*****************@nlpi065.nbdc.sbc.com...
Hi Everyone,

I'm writing a color picker control (combobox looking control, wonder why
.Net does not come with this control). It's a Button derived class that
when clicked, opens a form (without a title bar) just below it and
displays some "push like" colored radio buttons in it. I need to detect
when the user clicks anywhere outside the popup window so that I can close
it.

Setting Form.Capture to true won't help since the user won't be able to
click on the radio buttons.

I don't want to set a Windows hook, since that would tie the control to
the windows API.

I'm looking for a .Net way of doing this without directly tapping into the
API.

I would appreciate any suggestion.

Thanks
AliR.

Jun 30 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.