Disabling items on a ContextMenuStrip

Need to dynamically alter the dropdown contents to a ContextMenuStrip item?

 

Well the Opening and, if needed, the Closed events are your friends. Use the opening event to dynamically enable/disable items. You can also dynamically add new items in which case the Closed event is the place to remove them again.

 

Enjoy!

 

Maurice de Beijer

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>