[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
CppVclTRichEdit

(C++ VCL) TRichEdit

Visual component used for text display and editing. It is similar to Microsoft's WordPad text editor window.

Forward declaration:
namespace Comctrls { class TRichEdit; };


In the implementation (.cpp) file, #include ComCtrls.hpp:
  1. include <ComCtrls.hpp>


Adding a TStringList to a TRichEdit

Use TRichEdit's member function AddStrings.

std::auto_ptr<TStringList> stringList(new TStringList);
stringList->Add("Line1");
stringList->Add("Line2");
stringList->Add("Line3");
stringList->Add("Line4");
stringList->Add("Line5");
RichEdit1->Lines->AddStrings(stringList.release()); //Sets stringList to NULL


Note that if the last line would be
RichEdit1->Lines->AddStrings(stringList.get()); 
there would be no problem (at least, not that I've noticed). But in the upper example, you can be sure that stringList will not be modified after adding it to the TRichEdit, as after adding it, it is set to NULL.

'TRichEdit' links

There is no CLX version of TRichEdit

last edited (November 18, 2006) by bilderbikkel, Number of views: 1536, Current Rev: 3 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.