Can I create a control that has 2 menu’s characteristic:
- Do not take form’s focus on clicking.
- Automically disappear when clicking outside.
I intend to draw it manually, but I realise I can’t draw outside of form’s border like system menu.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are describing the
ToolStripControlHost, which can contain any control you want. Paired with theToolStripDropDown, and you have a very effective custom drop down control that will not take focus from the main form, and will close when clicked outside of it:Whatever myControl is, sometimes you have to set the MinimumSize of it equal to the size of the control. There are events you can handle for the ToolStripDropDown such as,
OpeningandClosing.