Click here to Skip to main content
15,919,341 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problem with String.Replace() Pin
Gump61923-Aug-07 8:08
Gump61923-Aug-07 8:08 
AnswerRe: Problem with String.Replace() Pin
Chase Davis23-Aug-07 7:08
Chase Davis23-Aug-07 7:08 
GeneralRe: Problem with String.Replace() Pin
Gump61923-Aug-07 7:16
Gump61923-Aug-07 7:16 
Questionregistry - create printer - redirect port Pin
HarryFlodder23-Aug-07 4:58
HarryFlodder23-Aug-07 4:58 
QuestionRichTextBox Formatting Help Pin
solutionsville23-Aug-07 3:46
solutionsville23-Aug-07 3:46 
AnswerRe: RichTextBox Formatting Help Pin
mav.northwind23-Aug-07 4:04
mav.northwind23-Aug-07 4:04 
AnswerRe: RichTextBox Formatting Help Pin
solutionsville23-Aug-07 4:32
solutionsville23-Aug-07 4:32 
AnswerRe: RichTextBox Formatting Help Pin
Big Daddy Farang23-Aug-07 7:35
Big Daddy Farang23-Aug-07 7:35 
I don't have a quick and easy answer for you, but you probably weren't expecting one. I can offer a little help though, I hope. I have used RichTextBox controls a little bit, but what I was doing was writing a simple "report, " saving it to a file, sending it to a client application that then displayed the file in a RichTextBox control.

Anyway, you said you wanted to use the .Rtf property. I didn't use it, but as I understand it, you'd need to load your rtf-formatted text into a string object, then
<br />
string rtfString = /* some magic loading */ ;<br />
rtbDoc.Rtf = rtfString ;<br />

What I did was:
<br />
richTextBox.LoadFile ( path ) ;<br />


I don't think that the .Rtf property is going to be much help, though. Here are my assumptions about things you've done so far:

You have data in a text-based file captured from a device or other source.
You opened a data file in Wordpad and found the text of interest.
You changed the interesting text to bold and blue.
You saved the result as .rtf file.
A portion of that file is shown in your post.

<br />
\cf1\b 01\cf0\b0<br />


This portion of that text means color foreground #1 from color table, bold, 01 (which is the interesting text), color foreground #0 (back to default color), bold off. The color table is defined on line 2:
<br />
{\colortbl ;\red0\green0\blue139;}<br />

I don't think that the 3 - 4 minute delay really has anything to do with rtf issues. I think that's time taken for findSequenceNumbers to parse the strings. I'd try putting some debug statements before and after a call to it. Find out how much time it is taking.

If my first assumption above is correct, my approach would be to process the data file a line at a time, looking for the tokens as seen in findSequenceNumbers and embedding the rtf instructions
<br />
\cf1\b <br />

and the like in the lines. Of course you'd also have to put the other rtf stuff in your StringBuilder or whatever. Not sure if that's really going to speed things up or not, it's just another way to skin the cat.

Hope this helps a little.

BDF
AnswerRe: RichTextBox Formatting Help Pin
solutionsville23-Aug-07 7:44
solutionsville23-Aug-07 7:44 
QuestionUser credentials cannot be used for local connections Pin
abhishek.mumbai23-Aug-07 3:41
abhishek.mumbai23-Aug-07 3:41 
AnswerRe: User credentials cannot be used for local connections Pin
SfBf2-Nov-09 16:47
SfBf2-Nov-09 16:47 
QuestionVS 2003 to VS 2005 migration problems Pin
Abhi Lahare23-Aug-07 3:38
Abhi Lahare23-Aug-07 3:38 
AnswerRe: VS 2003 to VS 2005 migration problems Pin
Paul Conrad26-Aug-07 9:23
professionalPaul Conrad26-Aug-07 9:23 
QuestionString Formate Pin
Thaer Hamael23-Aug-07 3:27
Thaer Hamael23-Aug-07 3:27 
AnswerRe: String Formate Pin
snorkie23-Aug-07 3:40
professionalsnorkie23-Aug-07 3:40 
GeneralRe: String Formate Pin
Keith Barrow23-Aug-07 3:52
professionalKeith Barrow23-Aug-07 3:52 
GeneralRe: String Formate Pin
DavidNohejl23-Aug-07 4:07
DavidNohejl23-Aug-07 4:07 
AnswerRe: String Formate Pin
Keith Barrow23-Aug-07 3:44
professionalKeith Barrow23-Aug-07 3:44 
AnswerRe: String Formate Pin
Martin#23-Aug-07 4:00
Martin#23-Aug-07 4:00 
AnswerRe: String Formate Pin
CCosgrove8123-Aug-07 7:08
CCosgrove8123-Aug-07 7:08 
QuestionAbout Httpwebrequst & response Pin
Dipti D Jadhav23-Aug-07 2:56
Dipti D Jadhav23-Aug-07 2:56 
QuestionGive me an idea about image processing Pin
greekius23-Aug-07 2:53
greekius23-Aug-07 2:53 
AnswerRe: Give me an idea about image processing Pin
Keith Barrow23-Aug-07 3:15
professionalKeith Barrow23-Aug-07 3:15 
AnswerRe: Give me an idea about image processing Pin
Justin Perez23-Aug-07 4:14
Justin Perez23-Aug-07 4:14 
GeneralRe: Give me an idea about image processing Pin
greekius23-Aug-07 21:31
greekius23-Aug-07 21:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.