C# Tutorial 26: Search and highlight text in Textbox or richTextBox in C#
How to highlight occurrences of a search term in text in Visual Studio Highlight Find Results C# Highlight all occurrences of selected word – Visual Studio C…
Video Tutorial Rating: 4 / 5
Don’t forget to check out our other video tutorials or share this video with a friend.
20 responses to “C# Tutorial 26: Search and highlight text in Textbox or richTextBox in C#”
Leave a Reply Cancel reply
Video Tutorials
Bringing you the best video tutorials for Photoshop, Illustrator, Fireworks, WordPress, CSS and others.
Video tutorial posted 27/02/15
Category: C# Tutorials
Pages
Random Videos
-
C# Tutorial 22 – Class Inheritance
4,082 views
-
Parallax Scrolling – HTML tutorial
6,395 views
-
Colourful Aurora Photoshop Video Tutorial
2,284 views
Video Categories
- 3DS Max Tutorials (150)
- After Effects Tutorials (160)
- C# Tutorials (121)
- Colour (6)
- Crazy Effects (1)
- CSS Tutorials (120)
- Dreamweaver Tutorials (139)
- Excel Tutorials (127)
- Featured (10)
- Fireworks Tutorials (131)
- General Effects (9)
- HTML Tutorials (143)
- Illustration and Vector (1)
- Illustrator Tutorials (174)
- IMove Tutorials (119)
- Lightroom Tutorials (145)
- People and Faces (3)
- Photoshop Tutorials (169)
- Text Effects (7)
- Uncategorized (32)
- WordPress Tutorials (140)
Tags
VideoTutorials.co.uk
-
Videotutorials.co.uk offers the web's best Photoshop tutorials, Illustrator video guides, CSS and HTML tutorials and much more all in one place. With new videos being added every day, you can learn how to master software and code to give your images and website some great effects.
Our site has beginner, intermediate and advanced video tutorials of varying lengths so you can learn a new skill at your own speed and level. So whether you're a web designer, print designer or just wanting to edit some family photos, you can get to it quickly and easily using these free video guides. (more)
I think It would be a smarter choice to use streamreader to open the file
With this code it un-formats my RTF, say I have set font to a size and
color, as soon as I do a search BOOM no more size and color. Do you have a
fix for this?
What is RichTextBoxFinds for a normal textbox? please help.
can you teach us how to search and open doc. file in VS??
How to count number of highlight?
This video saved my life! Thank you very much! :)
Greetings;
Once again nice tutorial.
You forgot to prevent users from messing up teir heads (lol).
As i was learning this i found myself with some issues.
1) Scrolling my RichTextBox (to find the matching words – while a seach is
active)
the RTB is always showing the it’s first lines / the top of the file)
I believe that to prevent this we have to know how to:
– Go to the first matching word
– Go to next found word (with a button for example)
Maybe some extra coding is needed. I’m not sure yet; as “search” funtion is
new for me.
Can you show us how it could be done?
Thanks in Advance
hi!!!!!!!!! can u upload a video about how to open command prompt using
c#?also how to run commands through c#?
The one problem with the highlighting is that it is case sensitive
how can you reference a xml file which is uploaded in rich textbox.if it
is in c drive then fine it it is in rich text box.. want to know for RTB.
var doc =
XDocument.Load(@”C:UsersIT-AdministratorDesktop2014-01-07_Middlesex.xml”);
working ….fine……
It would be good to clarify what the integer is…
Index = ???
I believe it’s the cursor location inside the textBox. But not sure
thanks
dont work in find number.
My question is, why do you initialize the RichTextBox.Text back to blank
and then re-input the same text value? Anyway, it put me on the right track
and I thank you for that. Although I use VB.Net, it is dead easy to
interpret C# Code into VB.Net (and vice-versa). Don’t you all just love the
.Net framework? 🙂
For the search to work more than once (i.e. a subsequent search is
performed) you must alter the first “While” statement to: while (index < richTextBox1.Text.LastIndexOf(textBox1.Text, richTextBox1.TextLength)
i really thank you for your very useful videos. in this tutoarial, the
program underlines the line “index = richTextBox1.Text.IndexOf(textBox1,
index) + 1;” telling that this method doesn’t exit with these arguments.
How can i fix it ?
Ghjhbkiguhhjjioiujgigtfjhfhfsfchk
thank for the video
how do i search the word regardless of letter case?
Firstly, thanks for these tutorials. Secondly when I search the first time
its fine, but the second time it does not search