473,396 Members | 1,785 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,396 software developers and data experts.

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(start,length) ;
this.SelectionColor = 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 6598
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.com

"Ryan Liu" <ad********@online.sh.cnwrote in message
news:Oh*************@TK2MSFTNGP04.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(start,length) ;
this.SelectionColor = 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.comдÈëÓʼþ
news:OG*************@TK2MSFTNGP05.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.com

"Ryan Liu" <ad********@online.sh.cnwrote in message
news:Oh*************@TK2MSFTNGP04.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(start,length) ;
this.SelectionColor = 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********@online.sh.cnwrote in message
news:ea**************@TK2MSFTNGP03.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.com>
дÈëÓʼþ
news:OG*************@TK2MSFTNGP05.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.com

"Ryan Liu" <ad********@online.sh.cnwrote in message
news:Oh*************@TK2MSFTNGP04.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(start,length) ;
this.SelectionColor = 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
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...
2
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,...
4
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...
11
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...
60
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...
8
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...
5
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...
22
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...
10
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
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,...
0
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...
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...
0
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,...

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.