help on richtextbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
i'm new to winforms.....

i need to display certain data on form in a texbox..
but few words in the data need to appear as colored text....

i've tried with textbox and rixhtextbox..but no luck...can anyone help me out
 
More or less like this:

rtx.Clear();
rtx.Text = "There is life on Mars";
rtx.Select(9,4);
rtx.SelectionColor = Color.Red;
rtx.SelectionFont = new Font(rtx.SelectionFont, FontStyle.Bold);

MH
 
thanks marius

but the problem is the selection works only once...
i've a big paragraph in which several words have to be in different colors..
how do i accomplish this?
 
AVL said:
thanks marius

but the problem is the selection works only once...
i've a big paragraph in which several words have to be in different
colors.. how do i accomplish this?

rtx.Clear();
rtx.Text = "There is life on Mars";
rtx.Select(9,4);
rtx.SelectionColor = Color.Red;
rtx.SelectionFont = new Font(rtx.SelectionFont, FontStyle.Bold);

rtx.Select(17,4);
rtx.SelectionColor = Color.Blue;
rtx.SelectionFont = new Font(rtx.SelectionFont, FontStyle.Bold);

MH
 
Back
Top