473,770 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what is fastest way to change text color?

Hi,

I want to change keywords text color in a text editor. I select RichTextBox
and use its Select() method to select keywords line by line, one by one,
then change its color.

this.Select(sta rt,length) ;
this.SelectionC olor = color ;

But turns out it is very slow for big file. Is there better way to do so?

Thanks a lot in advance!
Ryan
Jul 8 '06 #1
3 6623
Ryan,

You could always write an engine that would parse RTF files and change
the color on the fly. That's the only way I can think of doing it outside
of the RichTextBox.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Ryan Liu" <ad********@onl ine.sh.cnwrote in message
news:Oh******** *****@TK2MSFTNG P04.phx.gbl...
Hi,

I want to change keywords text color in a text editor. I select
RichTextBox
and use its Select() method to select keywords line by line, one by one,
then change its color.

this.Select(sta rt,length) ;
this.SelectionC olor = color ;

But turns out it is very slow for big file. Is there better way to do so?

Thanks a lot in advance!
Ryan


Jul 8 '06 #2
Then next question is:

I am try to write my own, but is there classes or open src code to handle
RTF format file in C#?

Thanks a million,
Ryan
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c omдÈëÓʼþ
news:OG******** *****@TK2MSFTNG P05.phx.gbl...
Ryan,

You could always write an engine that would parse RTF files and change
the color on the fly. That's the only way I can think of doing it outside
of the RichTextBox.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Ryan Liu" <ad********@onl ine.sh.cnwrote in message
news:Oh******** *****@TK2MSFTNG P04.phx.gbl...
Hi,

I want to change keywords text color in a text editor. I select
RichTextBox
and use its Select() method to select keywords line by line, one by one,
then change its color.

this.Select(sta rt,length) ;
this.SelectionC olor = color ;

But turns out it is very slow for big file. Is there better way to do
so?

Thanks a lot in advance!
Ryan


Jul 8 '06 #3
How about asking such questions someone who gives answers in milliseconds,
like uncle google? http://www.google.com/search?hl=en&q=rtf+c%23
http://www.codeproject.com/cs/library/nrtftree.asp

"Ryan Liu" <ad********@onl ine.sh.cnwrote in message
news:ea******** ******@TK2MSFTN GP03.phx.gbl...
Then next question is:

I am try to write my own, but is there classes or open src code to handle
RTF format file in C#?

Thanks a million,
Ryan
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om>
дÈëÓʼþ
news:OG******** *****@TK2MSFTNG P05.phx.gbl...
>Ryan,

You could always write an engine that would parse RTF files and
change
the color on the fly. That's the only way I can think of doing it
outside
of the RichTextBox.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Ryan Liu" <ad********@onl ine.sh.cnwrote in message
news:Oh******* ******@TK2MSFTN GP04.phx.gbl...
Hi,

I want to change keywords text color in a text editor. I select
RichTextBox
and use its Select() method to select keywords line by line, one by
one,
then change its color.

this.Select(sta rt,length) ;
this.SelectionC olor = color ;

But turns out it is very slow for big file. Is there better way to do
so?
>
Thanks a lot in advance!
Ryan




Jul 8 '06 #4

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

Similar topics

137
7182
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very pragmatic - 3) I usually move forward when I get the gut feeling I am correct - 4) Most likely because of 1), I usually do not manage to fully explain 3) when it comes true. - 5) I have developed for many years (>18) in many different environments,...
2
2477
by: Zambo via SQLMonster.com | last post by:
Hi! We have Sql Server 2000 in our server (NT 4). Our database have now about +350.000 rows with information of images. Table have lot of columns including information about image name, keywords, location, price, color mode etc. So our database don?t include the images itself, just a path to the location of every image. Keywords -field have data for example like this: cat,animal,pet,home,child with pet,child. Now our search use Full-Text...
4
4107
by: Danny Smith | last post by:
Can anyone help? I want to find the fastest way of inserting a large number of records (50,000+) into a SQL Server database (using C#). The records are held in memory and the options I can think of are: 1. Creating a DataSet in memory and then calling the DataAdapter.Update(dataSet) method. This runs an Insert query for each row and ends up being quite slow. Is there any way to insert a whole DataSet at
11
2114
by: Ignacio X. Domínguez | last post by:
Hi. I'm developing a desktop application that needs to store some data in a local file. Let's say for example that I want to have an address book with names and phone numbers in a file. I would like to be able to retrieve the name by searching for a given phone number the fastest I can. I have considered the posibility of using XmlTextReader with something like: <list> <item number="1234567"> <name>John Doe</name>
60
49192
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't be indexed/sorted. I don't want to load the entire file into physical memory, memory-mapped files are ok (and preferred). Speed/performance is a requirement -- the target is to locate the string in 10 seconds or less for a 100 MB file. The...
8
1968
by: Phil_Harvey | last post by:
I need to know how I scroll to a particular element with javascript. <label>&gt; <input name="tf_command" size="50" type="text"></label> for example I want the screen to scroll to this input box whenever something is entered. I have delbt with all the other stuff I want it to do, I just need to know how to make it scroll. Cheers
5
2180
by: beersa | last post by:
Hi All, I have to query the database with the string from text file. Here are the details: OS: WinXP Home Pro DB: Oracle 9.x The table in DB has 20,000 rows. The text file has 15,000 rows. I wrote a program and read the string from text file and run SELECT query in DB
22
2711
by: SETT Programming Contest | last post by:
The SETT Programming Contest: The fastest set<Timplementation Write the fastest set<Timplementation using only standard C++/C. Ideally it should have the same interface like std::set. At least the following methods must be implemented: insert(), find(), begin(), end(), erase(), size(), operator<(), and at least the forward iterator. Here, speed and correctness are the 2 most important factors. Functionally it should behave similar to...
10
1729
by: timor.super | last post by:
Hi all, Imagine I've an array of int : int anArray = new int; I want to extract all the integer that are superior to 500 I can do :
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10259
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
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
8933
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...
0
6710
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
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
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.