Board index » delphi » Getting content of RichEdit component at runtime

Getting content of RichEdit component at runtime

Hi, Kurt.

Check out the MEd sample at http://home.att.net/~robertdunn/Yacs.html.
If this does what you need to do, I can explain haw it is done.

robert

Quote
"Kurt M. Andersen" wrote:

> Hi there!

> I'm trying to make a notepad kinda-like app., but with
> PageFolders/TabSheets to make it possible to have multiple open
> documents at the same time.
> On each TabSheet, I have a RichEdit component and know I would like to
> get the contents of this component on the active page at runtime, to
> make it possible to save and do other operations on the contents.

> How do I do this? The TabSheet and RichEdit component are created on the
> run, so I can't get a hold of them by using their names.

> Hopefully, you understand my problem. Thanks in advance for any help
> what so ever.

> Kind regards

> Kurt M. Andersen
> k...@moskjaer-andersen.dk

 

Re:Getting content of RichEdit component at runtime


Hi there!

I'm trying to make a notepad kinda-like app., but with
PageFolders/TabSheets to make it possible to have multiple open
documents at the same time.
On each TabSheet, I have a RichEdit component and know I would like to
get the contents of this component on the active page at runtime, to
make it possible to save and do other operations on the contents.

How do I do this? The TabSheet and RichEdit component are created on the
run, so I can't get a hold of them by using their names.

Hopefully, you understand my problem. Thanks in advance for any help
what so ever.

Kind regards

Kurt M. Andersen
k...@moskjaer-andersen.dk

Re:Getting content of RichEdit component at runtime


Quote
In article <7ia2ap$od...@forums.borland.com>, Kurt M. Andersen wrote:
> On each TabSheet, I have a RichEdit component and know I would like to
> get the contents of this component on the active page at runtime, to
> make it possible to save and do other operations on the contents.

If each tabsheet only has a richedit, then you can use something like

  richedit := PageControl.ActivePage.Controls[0] as TRichEDit;

 Mike Orriss (TeamB)
 (No e-mail replies, please, unless explicitly requested!)

Re:Getting content of RichEdit component at runtime


Quote
Robert Dunn <robertd...@worldnet.att.net> wrote...
> Hi, Kurt.

> Check out the MEd sample at http://home.att.net/~robertdunn/Yacs.html.
> If this does what you need to do, I can explain haw it is done.

Hi, Robert

That's exactly what I'm looking for, please let me in on the procedure...

Thanks!

Kind regards

Kurt M. Andersen
k...@moskjaer-andersen.dk

Re:Getting content of RichEdit component at runtime


Hey, Kurt.

Well, there is nothing really magical here.  The MEd sample contains a
class (TFileTabSheet) derived from TTabSheet.  When instantiatied,
TFileTabSheet simply creates a TRichEdit (actually a decendent of
TRichEdit) and arranges it within the TFileTabSheet (TTabSheet).

Of course, the above is a tremendous simplifiction and probably is not
sufficient explanation.  What sort of problems are you having?

robert

Quote
"Kurt M. Andersen" wrote:

> Robert Dunn <robertd...@worldnet.att.net> wrote...

> > Hi, Kurt.

> > Check out the MEd sample at http://home.att.net/~robertdunn/Yacs.html.
> > If this does what you need to do, I can explain haw it is done.

> Hi, Robert

> That's exactly what I'm looking for, please let me in on the procedure...

> Thanks!

> Kind regards

> Kurt M. Andersen
> k...@moskjaer-andersen.dk

Re:Getting content of RichEdit component at runtime


Quote
Robert Dunn <robertd...@worldnet.att.net> wrote:
> Hey, Kurt.

> Well, there is nothing really magical here.  The MEd sample contains a
> class (TFileTabSheet) derived from TTabSheet.  When instantiatied,
> TFileTabSheet simply creates a TRichEdit (actually a decendent of
> TRichEdit) and arranges it within the TFileTabSheet (TTabSheet).

> Of course, the above is a tremendous simplifiction and probably is not
> sufficient explanation.  What sort of problems are you having?

Hi, Robert

I've been fooling a bit around on my own, and Mike gave me a solution to my
problem. Please, see his posting to my question.
Anyway, I appriciate yours and everyone elses help, with this matter.
Thanks.

Kind regards

Kurt M. Andersen
k...@moskjaer-andersen.dk

Other Threads