473,800 Members | 2,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically highlighting items in a rich textbox

Hi,

I want a rich textbox that dynamically highlights particular words
immediately after they are typed. Just looking for some general
tips...

I tried putting some code in a sub that handles the textchanged event
for that textbox. The issue here is that the focus jumps to the words
to be highlighted (naturally, I suppose, since my technique is to
search for specific words, select them, and highlight them). But I
need to get the words to highlight without moving around the caret,
thus interfering with the user's attempt to type!

Any suggestions? Thanks!!!
Fool
Nov 20 '05 #1
4 1926
Someone correct me if i'm wrong ;)

if you want to test on full words you could use the keypress event to test
on spaces and execute your code there (this would improve performance)
for to let the user continue typing you'll have to select the end of the
text. to prevent the user from typing in the middle of the text while you
are doing your thing you could set a boolean flag when you start your thing
and intercept the keys in the keypress event.
if you want the user to be able to continue when you are doing your thing
use the previous technique and instaid of ignoring the keys in the keypress
event store them in a string and add that string to the text when your thing
is finished.

i hope this is understandable :)

eric

"Fool" <fo**@fool.co m> wrote in message
news:ok******** *************** *********@4ax.c om...
Hi,

I want a rich textbox that dynamically highlights particular words
immediately after they are typed. Just looking for some general
tips...

I tried putting some code in a sub that handles the textchanged event
for that textbox. The issue here is that the focus jumps to the words
to be highlighted (naturally, I suppose, since my technique is to
search for specific words, select them, and highlight them). But I
need to get the words to highlight without moving around the caret,
thus interfering with the user's attempt to type!

Any suggestions? Thanks!!!
Fool

Nov 20 '05 #2
* Fool <fo**@fool.co m> scripsit:
I want a rich textbox that dynamically highlights particular words
immediately after they are typed. Just looking for some general
tips...


You will find a nice implementation in C# here (advanced):

<http://www.icsharpcode .net/OpenSource/SD/>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Thanks to both of you! I'll check out tutorial, but the first
suggestion also seems very sound.
On 21 Nov 2003 14:54:40 +0100, hi************* **@gmx.at (Herfried K.
Wagner [MVP]) wrote:
* Fool <fo**@fool.co m> scripsit:
I want a rich textbox that dynamically highlights particular words
immediately after they are typed. Just looking for some general
tips...


You will find a nice implementation in C# here (advanced):

<http://www.icsharpcode .net/OpenSource/SD/>


Nov 20 '05 #4
For what it's worth, the link leads to an interesting-looking open
source project... but I don't see the tutorial...?

On 21 Nov 2003 14:54:40 +0100, hi************* **@gmx.at (Herfried K.
Wagner [MVP]) wrote:
* Fool <fo**@fool.co m> scripsit:
I want a rich textbox that dynamically highlights particular words
immediately after they are typed. Just looking for some general
tips...


You will find a nice implementation in C# here (advanced):

<http://www.icsharpcode .net/OpenSource/SD/>


Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1877
by: powerranger | last post by:
I have a web page where I have dropdownlist box with autopostback set to true. The box has 3 items: 1, 2, and 3. I also have a Placeholder and a button. Each time the user change the value of the dropdownlist, I create dynamically one or x text box. Here is my code... for (int i = 0; i < Convert.ToInt32(ddListsRpt.SelectedValue); i++) { TextBox txtbx = new TextBox(); txtbx.Visible = true;
7
7586
by: mef526 | last post by:
I would like to reference a dynamically created control and I know the name. I would like to use the following: Dim strName as String = "txtControl1" ' This is the ".Name" used when textbox was dynamically created dim c as control = me.Controls(strName) Instead I have to do this:
4
2795
by: Patrick Porter | last post by:
Arrrgh! I have tried everything (ok, not EVERYTHING) but i cant get solve the problem of getting syntax highlighting in a rich textbox. in the code below, im attempting to highlight all of the words "ax". the matches works fine, but i cant get the highlighting to work correctly. any help? thanks, patrick Private Sub rtbCode_TextChanged(ByVal sender As System.Object, ByVal e As
3
1527
by: Patrick Porter | last post by:
I am looking at followin the suggestion made by Larry on my last post. (his reply is on the bottom) it seems that you can't directly mess with the rich text header text....specifically the addtion of the colortable (which defines which colors can be used) rtbCode.Rtf.Insert(10,"{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}") does nothing. neither does rewrting the entire header each time.... why is this? In order
4
5053
by: sydney.luu | last post by:
Hello, I would greatly appreciate if someone can show me how to dynamically build a Repeater with unknown number of columns at design time. I have looked various threads in this newsgroup, websites, MSDN and was not able to find something that would help me understand and code. I might not be searching for the right words or phrases. So if you know how to do this or know of links or websites that have information about this, please...
2
4288
by: Rich | last post by:
Greetings. I have a child form inside an MID parent form. The child form is wider than the MID parent form. The child form contains a number of textboxes which are positioned from left to right on the child form where the textbox on the right is not viewable because it extends beyond the right border of the MDI parent form. What I need to happen is when I tab through the textboxes - when I tab into the textbox on the right side of...
5
6764
by: Amoril | last post by:
I've read quite a few different message on various boards and for some reason I'm still having trouble wrapping my head around this viewstate maintenance and trying to get these dynamically created link buttons to stay wired up to their click events. I have what is basically a simply survey question generation page. The page first displays a few static fields and a dropdownlist of various options for the user to select. When the user...
4
5485
by: Neil | last post by:
Just found out that the Microsoft Rich Textbox does not support full text justification, since it's based on Version 1.0 of the RichEdit Window Class, and full text justification is only available in versions 3.0 or later of the class. However, also just found out that the new Rich Text property in Access 2007 ALSO does not support full text justification! This seems incredible, that MS would create a brand new application, and not...
16
11137
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might know one way or the other whether that was true or not, or could point me to an article or help text that would. What I have seen so far online and in Access 2007 help seems to confirm the above. But that (or at least (b)) seems incredible that it...
0
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10275
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.