|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to get parent control of the context menu stipi'm working on the context menu for the controls. the problem i'm facing right now is like this : i want to use one context menu for more then one controls lets say i want to use one context menu for 3 treeview controls as 3 of them shares same type of menu. what i'm not able to do is, i can not idetify which control has invoke the context menu's event. let say one of the treeview control has invoke an event "Reset" from the context menu. all i need to do is, to find out which treeview has invoked the event and needs to refill the treeview control. i tried to find out how to get the parent control but i failed to do so. tools c#.net 2.0 (VS.NET 2005) can anyone give me any kind of suggestion on this. thanks, Lucky Lucky wrote:
Show quoteHide quote > hi guys, In the ContextMenuStrip's Opening event, set a form-level private > i'm working on the context menu for the controls. > the problem i'm facing right now is like this : > i want to use one context menu for more then one controls lets say i > want to use one context menu for 3 treeview controls as 3 of them > shares same type of menu. > what i'm not able to do is, i can not idetify which control has invoke > the context menu's event. let say one of the treeview control has > invoke an event "Reset" from the context menu. all i need to do is, to > find out which treeview has invoked the event and needs to refill the > treeview control. > > i tried to find out how to get the parent control but i failed to do > so. variable to the ContextMenuStrip's SourceControl property. This is the control that invoked the context menu. Then in the Reset item's handler, you will be able to see who wants to be reset. I wanted to avoid using a variable, and just put the SourceControl in the *menu strip's* Tag property, but I couldn't work out how to get from a ToolStripMenuItem to its containing menu - can anyone enlighten me? -- Larry Lard larryl***@googlemail.com The address is real, but unread - please reply to the group For VB and C# questions - tell us which version Private Sub ContextMenuStrip1_Opening(ByVal sender As Object, ByVal e As _
System.ComponentModel.CancelEventArgs) Handles ContextMenuStrip1.Opening Debug.WriteLine(ContextMenuStrip1.SourceControl.Name.ToString) End Sub Show quoteHide quote "Lucky" <tushar.n.pa***@gmail.com> wrote in message news:1156939608.207354.91500@i3g2000cwc.googlegroups.com... > hi guys, > i'm working on the context menu for the controls. > the problem i'm facing right now is like this : > i want to use one context menu for more then one controls lets say i > want to use one context menu for 3 treeview controls as 3 of them > shares same type of menu. > what i'm not able to do is, i can not idetify which control has invoke > the context menu's event. let say one of the treeview control has > invoke an event "Reset" from the context menu. all i need to do is, to > find out which treeview has invoked the event and needs to refill the > treeview control. > > i tried to find out how to get the parent control but i failed to do > so. > > tools > c#.net 2.0 (VS.NET 2005) > > can anyone give me any kind of suggestion on this. > > thanks, > Lucky >
Concurrency violation at update
How to use this service ??? WSDL available How to dynamically instantiate a base calss (w/ args to constructor?) A Service in VB.NET 2005 using a form ? Where can we buy VB.net? How Microsoft does it? Date/Time problem do event VB6 to VB.Net ActiveX Document DLL (VBD) Inquiry... crystal report question |
|||||||||||||||||||||||