mpemberton
Programmer
I'm having a tough time adding formatting codes as I add text to the richtextbox. This is a simplified document conversion program where I'm reading in a document that has text that is marked as bold. I read in character by character adding to the richtextbox with rtb.text += newtext. Once I get finished with a section of text that needs to be bold, I select the text, change the selectedfont, then continue on adding text to the box. Unfortunately, the result is the complete box ends up in bold. I know it has to be something simple, so any help would be GREAT!
Here's some basic code I'm doing:
While read external file one character at a time
write character (.text += character)
if character is start of bold area
set temp var as .textlength (for starting point)
end if
if character is end of bold
.select(starting point,length)
.selectionfont = new font(current font info + bold)
end if
end while
I hope that makes sense, couldn't cut/paste the whole program. I've only seen programs where it is interactive changing. This is on the fly editing.
Mark
Here's some basic code I'm doing:
While read external file one character at a time
write character (.text += character)
if character is start of bold area
set temp var as .textlength (for starting point)
end if
if character is end of bold
.select(starting point,length)
.selectionfont = new font(current font info + bold)
end if
end while
I hope that makes sense, couldn't cut/paste the whole program. I've only seen programs where it is interactive changing. This is on the fly editing.
Mark