Sharing ContextMenuStrip on different forms

vblm

New member
Joined
Jan 19, 2010
Messages
4
Programming Experience
10+
Hi everybody,

Is it possible to share the same ContextMenuStrip and its subs on different forms ? I tried to set the Modifiers of one of my ContextMenuStrips in my main form to Public (and declare its subs as Public) but it is not available to controls in my child forms.

Thx !
 
It is 'available' but only in code, not in Design view. The default Friend modifier is sufficient. For example when loading a child form:
VB.NET:
Me.ContextMenuStrip = MainForm.MainContextMenuStrip
It is not necessary to change access for the event handlers (that are assigned in declaring form).
 
Back
Top