I have created a custom drawn search bar for an app i am working on. see picture: http://www.diamonddrake.com/test/imgs/mySearch.JPG

when the user clicks on the google icon to the left. a little borderless form opens with custom drawn buttons that have icons for other search engines, you get the drift. only I am having an issue with dismissing it. I would like it to act like a standard context menu. so when I click on anything anywhere else, it will close. i tried setting the form's mouse down event to close it, and its captured property to true, this works... only the buttons on the form don't get their mouse enter events.

So I ask, what is the standard procedure for this kind of thing? and if their isn't one, what is a good solution?

Post your code. If you handle a mouse event that should not be handled then it would stop the buttons from firing the event like you are describing. However these problems are complex in nature so you should probably upload a sample project :)

I just read some text about using a toolstripdropdown class for this purpose. but how I have been trying is on a button click event i create my popup form, show it, use point to screen to set its location, then in the constructor of the popup form I used capture=true, and give it an onmousedown event and just use this.Close(); the form then contains some custom drawn buttons that simply just change color when moused over using the mouse enter and leave events.

but when the capture property is set to true, the mouse events don't fire the custom buttons. but without that property set to true. the form doesn't close when you click off of the form like most people assume a context or popup menu would...

ideas?

This article has been dead for over six months. Start a new discussion instead.