VS 2008 - How To Highlight Multiple Lines In RichTextBox

Jul 14, 2009

How to highlight multi lines in Rich Textbox and know which lines are highlighted?

View 8 Replies


ADVERTISEMENT

Richtextbox Highlight Every Ten Lines?

Aug 23, 2011

I have a richtextbox, and I want to highlight the lines in groups of ten, alternating colours every ten lines.
I know I need to use:

Dim lineindex As Integer = Me.RichTextBox1.GetLineFromCharIndex(index)
Dim first As Integer = Me.RichTextBox1.GetFirstCharIndexFromLine(lineindex)
Me.RichTextBox1.Select(first, xxxx)
Me.RichTextBox1.SelectionBackColor = Color.Red

However I'm not sure what to put in Select to get it to select the whole line, and I'm not sure how to get it to change colour every ten lines (to yellow)

View 1 Replies

Highlight Single Lines In A RichTextBox?

Aug 20, 2008

i am making a lua editor that highlights reserved words and so.However I stuck in a highlighting part.I've made the reserver-words highlighting function but I got no idea how to make it highlight comment lines.

Could someone please help me? I want a function to search through the richtextbox and find lines that start with "--" and highlight them with green color.

View 3 Replies

VS 2008 Multiple Lines In RichTextBox?

Aug 26, 2009

How would I make it so that if someone presses a button, the richtextbox will have more then 1 line of text

RichTextBox1.Text = "Something like this, but 2+ lines"

View 6 Replies

Forms :: Insert Multiple Lines Into Richtextbox?

Mar 27, 2010

I'm working on a program that inputs a text box text into a RichTextBox via a button click. But when I click a button, it over writes the text that is already in the RichTextBox. How can I prevent this?

View 2 Replies

How To Hard Code Multiple Lines In A Richtextbox

May 18, 2010

I am attempting to hard code a richtextbox that has multiline characters upon the Load_Event. However, whenever I use the "&controlchars.newline _ " I get a syntax error and end of statement expected error.

[Code]...

View 3 Replies

Writing Multiple Lines To Richtextbox With Link Label

Apr 11, 2011

And just a FYI, I've spent about an hour looking this up... and I just can't seem to get it to work the way I wan't to. My application is simple, I have a "batch file editor". It has a richtextbox, a couple buttons for Open/Save/Test which are working fine.All I'm wanting to do is...

[Code]...

View 4 Replies

VS 2008 Highlight One Line And Remove It For RichTextBox?

Apr 27, 2009

After I add tons of text lines on RichTextBox, I need to select any line(s) by just clicking this line. After that this line is highlighted. Then I click one button to remove this line. How to do that? (the starting character for each line is the same)

View 9 Replies

2008 Count Lines In Textbox With Multiple Lines Using Label To Display The Numbers?

Sep 3, 2009

how to count the lines in textbox1.text (with multiplelines). I don't need to count each character. I only need to count each line from top to bottom in textbox1.text (multiplelines) and I will use Label1 to display the numbers.

example:

1-pauljaones
2-tommyperrry
3-marktoms
4-Jonessmith
5-paulwhite

Obviously this is 5 lines and that's what I need to count.

View 12 Replies

Way To Search A Richtextbox Textfile That Will Highlight All Word Finds And Then Send Them To Another Richtextbox?

Aug 26, 2010

I have a richtextbox with a large file inside....I want to be able to search for "Fornication" within the text (KJV Bible) and have every instance of that word to pop up into another richtextbox along with the scripture it is in.

View 1 Replies

VS 2008 RichTextBox - Determine Lines Have Changed?

Apr 23, 2011

I am working on a way to determine if the lines of a RichTextBox have changed.I currently use this

Dim newhash As Integer = Me.Text.GetHashCode
If newhash <> Me._prevhash Then
Me._prevhash = newhash
Me._lines = MyBase.Lines

[code]....

But this method has a bad issue: The text property takes a while to "load up" plus getting its hash code adds to it. This code runs every time the Lines are needed (it is a property). So this

For i As Integer = 0 To Lines.Count - 1
Dim line As String = Lines(i)
Next

Takes ages to complete, because for every line it checks if the lines have changed.I am trying to evade using MyBase.Lines too much, since that REALLY takes ages to load.

- I can not use the modified property since it is unreliable (set to true if only a text color changes)

- Can't use the RTF since it changes without the text changing (coloring) and the hash code is slow as well.

- Can't use the TextChanged event, since it is sent after the SelectionChanged event (for some reason)

View 4 Replies

Draw Lines In Highlight Pen Style?

Aug 19, 2011

I am making a drawing application (Graphics class), with a highlight pen and a calligraphy tool. But the pen tip should not rotate according to the line direction. I have tried the CustomLineCap, but still not working.

View 3 Replies

.net - Highlight Color In Richtextbox?

Jun 22, 2012

Public Sub textcolorchanged() Dim searchword As String = RichTextBox2.Text.ToString.Trim

[Code]...

I searched word of datagridview1 rows and highlighted search word in rich text-box. text(it is having total text) I called this method in datagridview1 mouse click and key-up and key down event

word is highlighted in rich text-box.text when I mouse click and key up and key down on datagridview1 rows of search word but some time getting full text is changed color how???

View 1 Replies

Highlight A Line In A Richtextbox

Jun 5, 2009

I wonder is there any way to highlight a line in a richtextbox once the user hovers the cursor over it and get its value? I am also looking for a way to define the colour of the selection (e.g., blue, balck, etc)

View 2 Replies

Highlight Lat Line In Richtextbox

Mar 21, 2010

i've created a project to highlight a few line in richtextbox1.but why cant i highlight the last line?below is my code:[code]

View 3 Replies

Highlight Words In A Richtextbox

Dec 21, 2011

I have a list of words that i need to find in a RIchtextbox, when the word is found, i want to highlight the word.

View 2 Replies

Highlight Certain Text Inside A RichTextBox ?

May 28, 2012

I am currently making a Syntax Highlighter.How can I highlight certain text inside a RichTextBox ? I am Currently Using This Code :

Public Function Highlight(ByVal highlightcolor As String, ByVal ParamArray WordsToFind() As Object)
'Loop through all the words you specified:
For i As Integer = 0 To UBound(WordsToFind)[code].....

but it will only Highlight 1 of the word I set / Change the whole text into the selected colour

Example :

'I wanted to Highlight "Hello"

'I put this code into RichTextBox_TextChanged:

Highlight("blue","Hello")

'And It will Only highlight The First "Hello" inside my Text :

'Hello my name is XXX, Hello

And, can I Highlight text between certain text / after certain text

Example :

'Highlight After the '
Or :

<!-- Highlight between these 2 tags -->

View 11 Replies

Highlight Links In Richtextbox With Program?

Aug 6, 2011

I can't find out the correct answer how to highlight words in hyperlinks using richtextbox.

The program which I'm creating is blueskycorp scraper which when type some words in text box and found links to my questions puts in richtextbox like links.

But the problem I can't find out untill is just how to highlight not words but links in richtextbox to match founded words and highlight them in richtextbox where is extracted links and only I want to mark these links.

View 7 Replies

RichTextBox Highlight All Instances Of A Phrase

Jul 7, 2010

In VB.Net, is it possible to highlight ALL instances of a phrase instead of only a single instance of it, for example: txtView.SelectionStart = txtView.Find("ERROR: Invalid command entered.") txtView.SelectionColor = Color.Red This would highlight "ERROR: Invalid command entered.", however if my RichTextBox text is: ERROR: Invalid command entered. < Only this line will highlight ERROR: Invalid command entered. ERROR: Invalid command entered. Alternatively, is there a way I can simply colour the line when I write it to the RichTextBox?

View 1 Replies

How To Get A RicHTextBox To Multi Highlight Selected Text

May 1, 2009

How can I get a RicHTextBox to Multi Highlight selected text? [code]

View 5 Replies

Way To Have A Richtextbox Display Highlight When It Loses Focus?

Mar 18, 2011

I have a richtextbox, when I leave it for example to go to another panel where I want to manipulate the selected text I can no longer see the selected text. Is there a way to make it still show the highlight?

View 1 Replies

VS 2008 Show A Message Box With Multiple Lines Before Buttons

Aug 28, 2009

I've been looking all over and i can't find an answer to this syntax problem. I want to show a message box with multiple lines before the buttons. This is my latest try:[code]How do you do this? Also, is there a way to have text AFTER the buttons?

View 12 Replies

VS 2008 Deleting Multiple Lines In A Text File?

Sep 20, 2009

I need to be able to search through a text file and find a line of text, then delete that line and the 7 previous lines and also the line following the searched line. Basically the program creates student records to a text file and asks if the user wants to mark the record for deletion then when the user exits the program, I want it to find the records mark for deletion and delete them.The records in the text file look like this:

Name: Some, Students, Name
Age: 20
Phone Number: (555) 555-5555

[code]....

View 1 Replies

VS 2008 Replacing Multiple Lines Of Text In A File

Jul 9, 2009

Sorry if this seems like I haven't searched, however I have. Maybe I'm not understanding something or maybe I just haven't found what I need. Anyway my question is this. How would I find multiple strings in a text file and replace them? So far I've been able to find out how to replace a single string with:

[Code]...

View 3 Replies

[2008] Multiple Lines Of Txt File -> Single String?

Feb 26, 2009

I have a *.txt file which contains instructions and data, with its own comments (preceded by ! ), blank lines, and each instruction begining on a new line, but occassionally using two lines. Each instruction consists of several feilds seperated by a TAB. Finally each instruction ends in a comma. Only a few different instructions are there (10 different ones) but there are many of each. Spanning a good 2500 lines. Comments and blank lines are obviously of no interest to me. I merely need to read the instructions and the data that follows it.

Now, I have successfully used 'System.IO.StreamReader.ReadLine' to go through it line by line, picking out lines begining with certain strings (first 3 characters of a known instruction). All good, I can 'lift' out the lines of interest and store them, for them to be split up later (seperating their fields into instruction, data, etc..) and then into an array.

The problem is, since some of the data fields in these instructions are so long, it spans two lines, before it ends with a comma. Using the above method, I end up with two array entries for a single instruction, since I have stored individual lines rather than a complete instruction. The only similar situation I can tihnk of to explain this, is to pick out sentences in text, and store each one in a string. Of course these end with a period (full stop) but span two or more lines.

I am hesitant to post an example, since its formatting is rather strange, but it is generated that way from 3rd party software, so I cannot change that for my software application.Perhaps there is no 'graceful' way of doing this, meaning I would have to find a way of 'adding' the second line of the instruction, to the string of the first line. Or perhaps reading each line character by character, literally storing every number/letter until I reach a comma.

View 4 Replies

VS 2008 - Change Multiple Selected Fonts In Richtextbox

May 17, 2012

iam using this code to change the font in a richtextbox it's work if user select a single font if there are multiple fonts, and font sizes it dosenot work

[Code]...

View 13 Replies

Media Player And RichTextBox - Highlight The Text Being Played And Auto-scroll When It Plays The Next Line

Feb 9, 2011

I am trying to build a language tool, basically I am getting lines of text into a richtextbox and playing the audio for that line. Things are working great except that I want to highlight the text being played and autoscroll when it plays the next line. how to implement the line highlighting and autoscrolling.

View 2 Replies

Add Lines In RichTextBox?

Aug 6, 2009

How to make RichTexBox when open a file to show the lines .To be like Notepad++ when open a file shows lines: Image:

Like .txt file thise sentences:

Hello!

How are you?

I'm Ok, Thanks for asking.

and when i start the program and open the file in richtextbox to show the lines of sentences . Like thise:

1. Hello!

2. How are you?

3. I'm ok, Thanks for asking.

How to be done? Because i'm using search button that show the word on what line is it.. so i need the lines people to know what line to search

View 1 Replies

Add Values Richtextbox Lines

Mar 4, 2010

Can somebody give me a hint how to multiply each line in a richtextbox with a value?The richtextbox will have ex. 1000 lines with numbers, and I want to multiply all these lines with with a number.

View 1 Replies

Number Lines In A RichTextBox?

Aug 20, 2010

I am working on a Programming notepad in VB.net, How would i add Line Numbers into a RichTextBox? An Example would be like in Notepade ++. Would i need to make a Class for it? I already have a class witch makes a richtextbox that when you type a word like "echo" it will change the color. Can i edit this to make the numbers? [code]

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved