best way to replicate Rich Text Box

  • Thread starter Thread starter microsoft
  • Start date Start date
M

microsoft

We have several rows of text we want to display but want to be able to
change at least the forecolor of the text by row. We are currently putting
this info in multiline text box, but no way there of course to discrimanetly
change the color of just one row. How are people accomplishing this? We
don't necessarily know ahead of time how many rows there will be or I guess
we could create separate text boxes.

Can we just print to the form? Can we dynamically create text boxes using a
control array? Is a control available that understands html? Maybe there
is a richtextbox control and we haven't found it. Thanks for suggestions.
 
I've figured out how to use the following so wanted to save someone's time
who might be responding (unless someone has a better suggestion).

I pass the data I want to display as a string array to the form. Display it
in a picture box (so I can use scroll bars to scroll the control) using the
paint event of the picturebox. This allows me to dim a couple different
font objects and SolidBrush objects and then use e.Graphics.Drawstring and
MyBase.OnPaint(e). Also can draw rectangles or whatever if I want.

Just got the basics working on a sample, but it looks like it should do the
job. Of course if there was an easier way...., but this doesn't look too
bad.
 
Back
Top