Selecting text event in RichTextBox

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Feb 2008
Posts: 3
Reputation: sreelakshmi is an unknown quantity at this point 
Solved Threads: 0
sreelakshmi sreelakshmi is offline Offline
Newbie Poster

Selecting text event in RichTextBox

 
0
  #1
Feb 22nd, 2008
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....
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 26
Reputation: harryl5 is an unknown quantity at this point 
Solved Threads: 1
harryl5 harryl5 is offline Offline
Light Poster

Re: Selecting text event in RichTextBox

 
0
  #2
Feb 22nd, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 25
Reputation: poguemahone is an unknown quantity at this point 
Solved Threads: 2
poguemahone's Avatar
poguemahone poguemahone is offline Offline
Light Poster

Re: Selecting text event in RichTextBox

 
0
  #3
Feb 22nd, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 25
Reputation: poguemahone is an unknown quantity at this point 
Solved Threads: 2
poguemahone's Avatar
poguemahone poguemahone is offline Offline
Light Poster

Re: Selecting text event in RichTextBox

 
0
  #4
Feb 22nd, 2008
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:
  1. If RichTextBox.SelectionLength > 0 Then
  2. MenuStripItems.Visible = True
  3. else
  4. MenuStripItems.Visible = False
  5. End If
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC