npuleio
asked on
TRichEdit and TFrame
Hello everyone!
I'm using C++ Builder 6.0 and I have a TFrame with inside a TPageControl where in a page I have a TRichEdit.
The fact is: I load some text from a database field into TRichEdit's text (and with debug I see I have text) but when I show the richedit I see like empty richedit.
Indeed I have a TRichEdit in another simple form and I can see the text... As you know it is maybe a bad issue between TRichEdit being in a TFrame instead of a TForm?...
Is there maybe a way to solve it, for example with API calls?...
Thanks a lot to everyone!
Ciao,
Luigi
I'm using C++ Builder 6.0 and I have a TFrame with inside a TPageControl where in a page I have a TRichEdit.
The fact is: I load some text from a database field into TRichEdit's text (and with debug I see I have text) but when I show the richedit I see like empty richedit.
Indeed I have a TRichEdit in another simple form and I can see the text... As you know it is maybe a bad issue between TRichEdit being in a TFrame instead of a TForm?...
Is there maybe a way to solve it, for example with API calls?...
Thanks a lot to everyone!
Ciao,
Luigi
edtDocumentation->Text = ADOQuery_Qry->Fields->Fields[2]->AsString;
ASKER
Hello George....
if I do that I get an exception "RichEdit line insertion error" doing the ->Add(...->AsString); thing and the text is just fine since when I inserted the text into database I did a paste from a Word document...
Same thing happens if I do:
TStringList* stringdocument = new TStringList();
stringdocument->Add(ADOQue ry_Qry->Fi elds->Fiel ds[2]->AsS tring);
edtDocumentation->Lines->A ddStrings( stringdocu ment);
ciao,
Luigi
if I do that I get an exception "RichEdit line insertion error" doing the ->Add(...->AsString); thing and the text is just fine since when I inserted the text into database I did a paste from a Word document...
Same thing happens if I do:
TStringList* stringdocument = new TStringList();
stringdocument->Add(ADOQue
edtDocumentation->Lines->A
ciao,
Luigi
ASKER
Hello again,
I have also a TWinControl component where I created a format-text toolbar and a RichEdit, where specifically for the RichEdit I passed to the ancestor something like this:
#define RICHEDIT30 "Riched20.dll"
if (!_RichEditModule)
_RichEditModule = ::LoadLibrary(RICHEDIT30);
if (_RichEditModule != 0) {
Ancestor::CreateParams();
CreateSubClass(Params, RICHEDIT_CLASSA);
...
...
}
So I would manage also TStrings Lines... how I could get and pass Lines between the handle creating a property Lines?...
Thanks
Ciao, Luigi
I have also a TWinControl component where I created a format-text toolbar and a RichEdit, where specifically for the RichEdit I passed to the ancestor something like this:
#define RICHEDIT30 "Riched20.dll"
if (!_RichEditModule)
_RichEditModule = ::LoadLibrary(RICHEDIT30);
if (_RichEditModule != 0) {
Ancestor::CreateParams();
CreateSubClass(Params, RICHEDIT_CLASSA);
...
...
}
So I would manage also TStrings Lines... how I could get and pass Lines between the handle creating a property Lines?...
Thanks
Ciao, Luigi
ASKER
Actually, to avoid that exception "RichEdit line insertion error", I put an ugly try { .... } catch(Exception &e) { } at least it works...
Ciao, Luigi
Ciao, Luigi
ASKER
Couldn't get a good answer actually... and it works quite OK with a try { } catch(Exception &e) { } so I solved it with that.
For a moderator, can be this question closed?..Thanks
For a moderator, can be this question closed?..Thanks
Ooops...
Sorry...
Forgot to answer...
I'll be back to you in a few hours....
George Tokas.
Sorry...
Forgot to answer...
I'll be back to you in a few hours....
George Tokas.
Hello again Luigi,
I tried having a RichEdit control in a frame and I added lines and from a control (TButton) outside the frame and works ok...
Try the following:
AnsiString S;
S = ADOQuery_Qry->Fields->Fiel ds[2]->AsS tring;
RichEdit->Lines->Add(S);
Is that failing also??
George.
I tried having a RichEdit control in a frame and I added lines and from a control (TButton) outside the frame and works ok...
Try the following:
AnsiString S;
S = ADOQuery_Qry->Fields->Fiel
RichEdit->Lines->Add(S);
Is that failing also??
George.
ASKER
I tried that too but it failed too... I tried also something like this:
TStringList* ts = new TStringList(ADOQuery_Qry-> Fields->Fi elds[2]->A sString);
RichEdit->Lines->Add(ts);
since Lines is a TStrings, but it failed that too...
TStringList* ts = new TStringList(ADOQuery_Qry->
RichEdit->Lines->Add(ts);
since Lines is a TStrings, but it failed that too...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To add strings in a TrichEdit its the same as TMemo:
TRichEdit->Lines->Add(TheA
or TStrings:
TRichEdit->Lines = TStringList;
so if edtDocumentation = TRichEdit
then:
edtDocumentation->Lines->A
George Tokas.