Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>the best idea is probably to use PropertyGrid control to show selected (clicked) object properties: <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.propertygrid.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/system.windows.forms.propertygrid.aspx</a></p> <p><a href="http://msdn.microsoft.com/en-us/library/aa302326.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa302326.aspx</a></p> <p>Most of the logic for "standard property types" like String, Int... is already implemented in this control</p> <p>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.</p> <p>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:</p> <pre><code> private void Button1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { if (e.Button == MouseButtons.Right) { PropertyGridForm f = new PropertyGridForm(); f.PropertyGrid.SelectedObject = Button1; // (or sender?) whatever you need f.Location = e.Location; f.Show(); //or ShowDialog? } } </code></pre> <p>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.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload