Click here to Skip to main content
15,913,115 members
Home / Discussions / C#
   

C#

 
AnswerRe: (nOOb help) comparing ArrayLists of structs.. Pin
ghle24-Aug-07 11:08
ghle24-Aug-07 11:08 
AnswerRe: (nOOb help) comparing ArrayLists of structs.. Pin
Luc Pattyn24-Aug-07 13:37
sitebuilderLuc Pattyn24-Aug-07 13:37 
QuestionHow do I incorporate these two routines? Pin
solutionsville24-Aug-07 9:21
solutionsville24-Aug-07 9:21 
AnswerRe: How do I incorporate these two routines? Pin
Hessam Jalali24-Aug-07 9:55
Hessam Jalali24-Aug-07 9:55 
AnswerRe: How do I incorporate these two routines? Pin
solutionsville24-Aug-07 10:16
solutionsville24-Aug-07 10:16 
AnswerRe: How do I incorporate these two routines? Pin
Big Daddy Farang24-Aug-07 12:37
Big Daddy Farang24-Aug-07 12:37 
AnswerRe: How do I incorporate these two routines? [modified] Pin
solutionsville24-Aug-07 17:54
solutionsville24-Aug-07 17:54 
GeneralRe: How do I incorporate these two routines? Pin
Big Daddy Farang27-Aug-07 10:03
Big Daddy Farang27-Aug-07 10:03 
Hi Brian,

I had a good weekend, hope you did too.

That's going to be a bit more involved. There are two approaches that I see, no doubt there are others as well.

First approach is to get the data from the file into memory using ReadFileIntoStringCollection() which now also does the work formerly done in LayoutInput(). Now the data is in a StringCollection object, from there it needs to go into the RichTextBox control. I don't know the best way to do this, it will take a little bit of experimentation. It might be as simple as rtbDoc.Text = result.ToString(); but I'm not sure that will work. You might have to iterate through result appending each string element onto rtbDoc.Lines or something like that. Once that data is in the RichTextBox control you can just call findSequenceNumbers(). This would offer the advantage of still being able to Select() a portion of the text and change the SelectionFont and SelectionColor. A big disadvantage might be the effort of getting the data into the RichTextBox control and the possible time used by findSequenceNumbers().

Second approach involves more hacking up of the findSequenceNumbers() function and copying it into ReadFileIntoStringCollection(). To do this, instead of searching for your targets in lines[lineNum] you'll search in an element of result. Probably you can still use the [] array notation, seems to work with most Collection objects. But now you can't just set the SelectionFont and SelectionColor properties because we have just a plain old string, not the contents of a RichTextBox control. Instead you'll need to insert the raw rtf formatting sequences. Also you'll need to put some other rtf stuff into the beginning elements ofresult as well as some ending stuff once the file reading is done.

If you use the second approach, we find ourselves back to the problem of getting the StringCollection object into the RichTextBox control. Except now we're hoping that rtbDoc.Rtf = result.ToString(); is the silver bullet. You might consider putting in a temporary statement like
string temp = result.ToString();
in the while loop when reading the file. Just so you can see in the debugger what is going to returned by calling ToString() on a StringCollection object. Another thing to beware of is that you proably need to append "\r\n" to the end of each string element of result in order to see the line breaks in the RichTextBox control.

I would probably do the searching of each line just after it's been read and preprocessed. I haven't thought too much about handling the ProgessBar etc., but I'd worry about that after the other stuff gets worked out.

Hope this helps a little.


BDF
AnswerRe: How do I incorporate these two routines? Pin
solutionsville27-Aug-07 12:32
solutionsville27-Aug-07 12:32 
GeneralRe: How do I incorporate these two routines? Pin
Big Daddy Farang27-Aug-07 12:39
Big Daddy Farang27-Aug-07 12:39 
Questiongetting infragistics Pin
starist24-Aug-07 9:12
starist24-Aug-07 9:12 
AnswerRe: getting infragistics Pin
Alaric_24-Aug-07 9:27
professionalAlaric_24-Aug-07 9:27 
GeneralRe: getting infragistics Pin
Dan Neely24-Aug-07 10:06
Dan Neely24-Aug-07 10:06 
QuestionI need a full stop Pin
humayunlalzad24-Aug-07 8:41
humayunlalzad24-Aug-07 8:41 
AnswerRe: I need a full stop Pin
PIEBALDconsult24-Aug-07 9:04
mvePIEBALDconsult24-Aug-07 9:04 
GeneralRe: I need a full stop Pin
Alaric_24-Aug-07 9:05
professionalAlaric_24-Aug-07 9:05 
AnswerRe: I need a full stop Pin
Alaric_24-Aug-07 9:04
professionalAlaric_24-Aug-07 9:04 
AnswerRe: I need a full stop Pin
PIEBALDconsult24-Aug-07 11:58
mvePIEBALDconsult24-Aug-07 11:58 
GeneralRe: I need a full stop Pin
martin_hughes24-Aug-07 11:49
martin_hughes24-Aug-07 11:49 
GeneralRe: I need a full stop Pin
humayunlalzad24-Aug-07 14:55
humayunlalzad24-Aug-07 14:55 
GeneralRe: I need a full stop Pin
PIEBALDconsult24-Aug-07 18:42
mvePIEBALDconsult24-Aug-07 18:42 
QuestionHELP WITH SKYNET!!! Pin
Alaric_24-Aug-07 8:30
professionalAlaric_24-Aug-07 8:30 
AnswerRe: help help help Pin
Alaric_24-Aug-07 8:34
professionalAlaric_24-Aug-07 8:34 
JokeRe: help help help Pin
PIEBALDconsult24-Aug-07 8:41
mvePIEBALDconsult24-Aug-07 8:41 
GeneralRe: help help help Pin
Alaric_24-Aug-07 8:48
professionalAlaric_24-Aug-07 8:48 

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.