943,723 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 3603
  • VB.NET RSS
Feb 22nd, 2008
0

Selecting text event in RichTextBox

Expand Post »
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....
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sreelakshmi is offline Offline
3 posts
since Feb 2008
Feb 22nd, 2008
0

Re: Selecting text event in RichTextBox

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
Reputation Points: 10
Solved Threads: 1
Light Poster
harryl5 is offline Offline
26 posts
since Feb 2008
Feb 22nd, 2008
0

Re: Selecting text event in RichTextBox

Try using the RichTextBox_SelectionChanged Event.
Inside of the event handler test the SelectionLength property of the RichTextBox like this:
[code]
If RichTextBox.SelectionLength > 0 Then
MenuStripItems.Visible
else

End If
Reputation Points: 13
Solved Threads: 2
Light Poster
poguemahone is offline Offline
25 posts
since Aug 2007
Feb 22nd, 2008
0

Re: Selecting text event in RichTextBox

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:
VB.NET Syntax (Toggle Plain Text)
  1. If RichTextBox.SelectionLength > 0 Then
  2. MenuStripItems.Visible = True
  3. else
  4. MenuStripItems.Visible = False
  5. End If
Reputation Points: 13
Solved Threads: 2
Light Poster
poguemahone is offline Offline
25 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: PLZ let me know how to store a respond of a MSG BOX
Next Thread in VB.NET Forum Timeline: Help with my basketball project





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC