J
JJ
I'm trying to create the cut/paste/select all context menu on number of
richtextboxes.
On the contextmenu.popup handler, I want to find out what control is
currently displaying the context menu. I thought I could use:
Private Sub KL_ClipboardContMenu_Popup(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles KL_ClipboardContMenu.Popup
'To find out which control is displaying the context menu:
Try
Dim thisControl As Control = KL_ClipboardContMenu.SourceControl
Debug.WriteLine(thisControl.ToString)
Catch ex As Exception
Debug.WriteLine("oops!!!" & ex.Message)
End Try
end sub
- an exception if thrown if the control is a rich text box, and not a
textbox. How am I supposed to do this with a rich text box?
Thanks
richtextboxes.
On the contextmenu.popup handler, I want to find out what control is
currently displaying the context menu. I thought I could use:
Private Sub KL_ClipboardContMenu_Popup(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles KL_ClipboardContMenu.Popup
'To find out which control is displaying the context menu:
Try
Dim thisControl As Control = KL_ClipboardContMenu.SourceControl
Debug.WriteLine(thisControl.ToString)
Catch ex As Exception
Debug.WriteLine("oops!!!" & ex.Message)
End Try
end sub
- an exception if thrown if the control is a rich text box, and not a
textbox. How am I supposed to do this with a rich text box?
Thanks