W
wandii
Hi,
I am trying to show the shortcut menu on a richtextbox control by
adding the contextmenu component onto the form. The richtextbox
property is assigned to the contextmenu. I created my shorcuts, copy,
paste, etc. However, on the form I have a datagrid
which is also assigned to the same contextmenu and contextmenupopup
event as follows:
....
If ContextMenu1.SourceControl Is richtextbox1Then
' Add MenuItems to display for the TextBox.
ContextMenu1.MenuItems.Add(menuItem1)
ContextMenu1.MenuItems.Add(menuItem2)
ElseIf ContextMenu1.SourceControl Is datagrid1 Then
' Add the MenuItem
ContextMenu1.MenuItems.Add(menuItem3)
End If
....
when I right-click on the richtext control I get the sourcecontrol =
Nothing, but r-click on grid
i get the control name. I droped the richtext control and added another
one and set the
cmenu property and still nothing. Any idea?
Thanks in advance
I am trying to show the shortcut menu on a richtextbox control by
adding the contextmenu component onto the form. The richtextbox
property is assigned to the contextmenu. I created my shorcuts, copy,
paste, etc. However, on the form I have a datagrid
which is also assigned to the same contextmenu and contextmenupopup
event as follows:
....
If ContextMenu1.SourceControl Is richtextbox1Then
' Add MenuItems to display for the TextBox.
ContextMenu1.MenuItems.Add(menuItem1)
ContextMenu1.MenuItems.Add(menuItem2)
ElseIf ContextMenu1.SourceControl Is datagrid1 Then
' Add the MenuItem
ContextMenu1.MenuItems.Add(menuItem3)
End If
....
when I right-click on the richtext control I get the sourcecontrol =
Nothing, but r-click on grid
i get the control name. I droped the richtext control and added another
one and set the
cmenu property and still nothing. Any idea?
Thanks in advance