473,395 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Select line in RichTextBox

How to select line in a RichTextBox?i mean like item in ListBox control.
Aug 17 '07 #1
1 2078
kenobewan
4,871 Expert 4TB
Expand|Select|Wrap|Line Numbers
  1.  ' get the selected RTF text if there is a selection,
  2.     ' or the entire text is no text is selected
  3.     Dim rtfText, plainText As String
  4.     If rtb.SelectionLength > 0 Then
  5.         rtfText = rtb.SelectedRtf
  6.         plainText = rtb.SelectedText
  7.     Else
  8.         rtfText = rtb.Rtf
  9.         plainText = rtb.Text
  10.     End If
Aug 18 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Martin Dew | last post by:
I have a RichTextBox called rtbOutput. I am adding lines of text using the AppendText method. What I want to do is immediately after adding this line of text make sure that this line of text is...
1
by: tb | last post by:
I need to select a particular line in a RichTextBox so I can perform formatting operations on it. I have the line index, I just don't know how to select it. Can anyone please help? Thanks.
22
by: DraguVaso | last post by:
Hi, For my application I need the following behavior: When I press F4 the cursor has to move to the next line in my multiline textbox which begins with "0". Finding lines starting with 0 isn't...
4
by: M O J O | last post by:
Hi, I'm using a RichTextBox with WordWrap=True and MultiLine=False. When the text is to long, it fills more lines. How do I get the number of lines the text uses? Thanks!
2
by: Just Me | last post by:
I insert text in a RichTextBox ending each line with vbCrLf. I think when I search the RichTextBox text I do not find any CR's. In the Text property is the end of line char a LineFeed? Are...
2
by: RobKinney1 | last post by:
Hello and thank you for reading this post. I have a RichTextBox. I need to select text inside for a search feature. Easy enough... right? Well apparently from the .NET help and everything from...
2
by: AWesner | last post by:
I am currently working to create a VB program that will do more detailed in-file text search functions than windows has to offer. I have a form with a RichTextBox control to display the text that...
4
by: Franky | last post by:
What I want to do is delete the last line in a RichTextBox. The RichTextBox has a ReadOnly property called lines that seems like it might help but I cant figure out how to use it. Well, the...
4
by: Aussie Rules | last post by:
Hi, I want to be able to show a txt file(stored on disk) to the end user in some sort of txt editor control, and allow the user to highlight/select words within the text. Once they have...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.