Board index » cppbuilder » using TRichEdit

using TRichEdit


2004-02-19 08:41:38 PM
cppbuilder43
I need to use a TRichEdit to do the following:
The first line must be bold and underlined,
all other line must be plain.
The text will be hard coded in.
Can anyone point me to an example on how to do this?
Thanks
 
 

Re:using TRichEdit

Hello Charles
If the text is hardcoded you can open rtf file into your richedit component,
when you start your application. You can create this rtf file with Word
editor for example, where you can use bold and underlining easily.
Jarkko
"Charles" < XXXX@XXXXX.COM >kirjoitti viestiss?
Quote
I need to use a TRichEdit to do the following:
The first line must be bold and underlined,
all other line must be plain.
The text will be hard coded in.

Can anyone point me to an example on how to do this?
Thanks



 

Re:using TRichEdit

Charles wrote:
Quote
I need to use a TRichEdit to do the following:
The first line must be bold and underlined,
all other line must be plain.
The text will be hard coded in.

Can anyone point me to an example on how to do this?
Thanks
Place all the text in your RichEdit1;
1. Select the first line with setting values for RichEdit1->SelSTart
and RichEdit1->SelLength.
2. RichEdit1->SelAttributes->Style =
RichEdit1->SelAttributes->Style << fsBold;
RichEdit1->SelAttributes->Style =
RichEdit1->SelAttributes->Style << fsUnderline;
3. Remove the selection and remove the attributes.
Hans.
 

{smallsort}

Re:using TRichEdit

"Hans Galema" < XXXX@XXXXX.COM >wrote in message
Quote
Place all the text in your RichEdit1;

1. Select the first line with setting values for RichEdit1->SelSTart
and RichEdit1->SelLength.

2. RichEdit1->SelAttributes->Style =
RichEdit1->SelAttributes->Style << fsBold;

RichEdit1->SelAttributes->Style =
RichEdit1->SelAttributes->Style << fsUnderline;

3. Remove the selection and remove the attributes.

Hans.
Thanks, that worked, but when I open the form with the richedit component on
it,
it displays at the bottom if the rich edit box. How can I set it the
display from the top?
Thanks
 

Re:using TRichEdit

Charles wrote:
Quote
.... when I open the form with the richedit component on
it,
it displays at the bottom if the rich edit box. How can I set it the
display from the top?
Don't understand what you try to tell.
What do you mean with the second and third "it" ?
Hans.
 

Re:using TRichEdit

"Hans Galema" < XXXX@XXXXX.COM >wrote in message
Quote
Charles wrote:
Don't understand what you try to tell.

What do you mean with the second and third "it" ?

Hans.
.... when I open the form with the richedit component on
it,
the richedit displays at the bottom of the rich edit box. How can I set
the richedit to
display from the top?
 

Re:using TRichEdit

Charles wrote:
Quote
.... when I open the form with the richedit component on
it,
the richedit displays at the bottom of the rich edit box.
Displays what ? If there is content/text in the richedit, the
firstline of text is shown from the top and so on.
If you see only text at lower lines, then did you check
what is above them ? Can you move the cursor to those
lines ? Are the first lines empty ? Pleas be exact.
Quote
How can I set
the richedit to
display from the top?
It does display the first tekstline on top, but an empty line
would not be visible.
Hans.
 

Re:using TRichEdit

"Charles" < XXXX@XXXXX.COM >wrote in message
Quote
.... when I open the form with the richedit component
on it, the richedit displays at the bottom of the rich edit box.
How can I set the richedit to display from the top?
Scroll the RichEdit back to the top:
RichEdit1->SelStart = 0;
RichEdit1->Perform(EM_SCROLLCARET, 0, 0);
Gambit