context menu objects  
Author Message
gregaug





PostPosted: Visual C# General, context menu objects Top

hello,

I was wondering if it was at all possible to use objects in context menus, not just text. i.e., I want to have an object that has a text value (.text) and a number value(.num). The text value is what would be displayed in the context menu, but the number value is what I would act on in my event handler. Thank you for any help.



Visual C#10  
 
 
nobugz





PostPosted: Visual C# General, context menu objects Top

Consider using the MenuItem.Tag property. It is of type Object and can store anything you want, including a value.



 
 
gregaug





PostPosted: Visual C# General, context menu objects Top

Thank you!