0

Is there any eventhandler for RichTextBox in vb.net to catch the selection of text event?
I want to enable cut,copy,delete control mentu strip items on selecting text.

Edit > cut,copy,paste,delete

Only on selecting text the cut,copy,delete should be enabled

Please help me out....

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by poguemahone
0

I don't think there is an event for a rich text box, or if there is, I do not know about it, but what you could do is use a normal Textbox, with the option of 'multi line', and I am sure it will be easier to selecting an event.
Hope this helps :)
x

0

Try using the RichTextBox_SelectionChanged Event.
Inside of the event handler test the SelectionLength property of the RichTextBox like this:

    If RichTextBox.SelectionLength > 0 Then
            MenuStripItems.Visible
    else

    End If

Edited by diafol: fixed formatting

0

Sorry, my first one was incomplete.

Try using the RichTextBox_SelectionChanged Event.
Inside of the event handler test the SelectionLength property of the RichTextBox like this:

If RichTextBox.SelectionLength > 0 Then
            MenuStripItems.Visible = True
        else
             MenuStripItems.Visible = False
        End If
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.