Re: Re: Displaying text in a TRichEdit?


Posted by Jeff on February 22, 2001 at 16:33:41:

In Reply to: Re: Displaying text in a TRichEdit? posted by webmaster Guido on February 22, 2001 at 14:22:36:

I figured out how to do it a little different.
What do you think about this?

procedure TForm1.SpeedButton5Click(Sender: TObject);
var Question, Answer : String;
begin
  Question := ‘What is your name’;
  Answer := ‘John Smith’;
  RichEdit1.SelAttributes.Style := [fsBold];
  RichEdit1.SelText := Question;
  RichEdit1.SelAttributes.Style :=  
    RichEdit1.SelAttributes.Style - [fsBold];
  RichEdit1.SelText := '  ' + Answer;
  RichEdit1.Lines.Add('');
end;


Related Articles and Replies: