how to make a property grid like context menu for button ?
So when right click on button . property grid will be visible and when click some where else , that will hide.
how to make a property grid like context menu for button ? So when
Share
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.
the best idea is probably to use PropertyGrid control to show selected (clicked) object properties:
http://msdn.microsoft.com/en-us/library/system.windows.forms.propertygrid.aspx
http://msdn.microsoft.com/en-us/library/aa302326.aspx
Most of the logic for “standard property types” like String, Int… is already implemented in this control
But I would not show it immediately on right click. Standard way in all windows apps is, when you make right click on a object, you get context menu specific for that object, and the last item is usually “Properties…”. After you select that option the property grid will be displayed.
If you want to display context menu with PropertyGrid control, I am not sure that it is supported with context menu control. But one way to do it would be to make new form, “PropertyGridForm”, with that PropertyGrid on it. Then, on your Object.CellMouseDown event just show that form, something like this:
You will have to find the best way to close that form. Will you make Close button on it, close it on Leave event, Deactivate event? Depends what behavior exactly you need.