473,320 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Get mouse global clicks without a hook

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
1 3039
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: paul francis | last post by:
Hi Please help because I'm really stuck: I'm trying to write an application in C# which can be used to track the mouse pointer position on any window. I'm trying to use a Global mouse hook to...
2
by: Benoit Martin | last post by:
Is it possible to detect a mouse click from a .net service. I want a process running in the background that will detect when the user clicks the mouse button (anywhere on the screen) and executes...
6
by: lauren quantrell | last post by:
I have a command button on a continuous subform and I want the user to click it to open a small popup form that opens in the position of the mouse (which is the same as the position of the command...
9
by: Will Pittenger | last post by:
If I were writing a C++ program, I would write a mouse hook. Does C# and ..NET 1.1 have anything equivalent. If not, I suppose I will need to use the Win32 API. ---------- Will Pittenger...
3
by: Rick Strahl [MVP] | last post by:
I'm working on an app that's using the WebBrowser control. I got the control working fine, hooking to the document object. But I've run into a major issue with hooking the Document events....
3
by: Per Larsson | last post by:
Hi! I've developed an application, and I want to use a semi opac form to show the help. The idea is to show the transparent help form on top (TopMost = True)and still be able to work with the...
1
by: Tom Rahav | last post by:
Hello, I try to develop application that runs in the background and suppose to display a small form with menu whenever the user clicks the middle mouse button (also when my application is not the...
2
by: Rodrigo Ferreira | last post by:
How can i detect mouse clicks on any windows application and get information about the application that has been clicked? Thanks!
22
by: schneider | last post by:
I need to hook the system mouse down event. I'm trying to replicate how a context menu hides when the mouse clicks outside of the control. Thanks, Schneider
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.