Solved

Printing contents of RichEdit

Posted on 2000-03-04
3
264 Views
Last Modified: 2013-11-22
Hi Experts,


In my application I have a Form with a PageControl on it.
At runtime I create the TabSheets for the Pagecontrol.
On each TabSheet I put (also at runtime of course) a RichEdit.

Now my question:
  I also have a button on the Form which has to print the contents
  of the RichEdit of the CURRENTLY SELECTED tabsheet.
  How can I do this ?


Thanx in advance,

The Mayor.
0
Comment
Question by:wimmeyvaert
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 50 total points
ID: 2583399
hi,

you can do like below:
Regards Barry


procedure TForm1.Button1Click(Sender: TObject);
var
  i : integer;
begin
with pagecontrol1.ActivePage do begin
  for i := Controlcount -1 downto 0 do
    begin
      if( Controls[ i ] is TRichedit )then
      begin
        (Controls[ i ] as TRichedit).Print('');
      end;
  end;
 end;
  end;
0
 
LVL 6

Author Comment

by:wimmeyvaert
ID: 2591319
Hi Barry,

Thanks for your answer !

Shortly before you posted your answer, I had found a solution myself, but I have to admit yours is better than mine.

Therefor, I'll accept your answer and give you the points.

Thanx again,

The Mayor.

By the way, do you know the existance of a dbgrid-freeware component (with source) which has more functionality than the one that comes with Delphi (automatically sorting columns, ...) ?
0
 
LVL 17

Expert Comment

by:inthe
ID: 2592403
hi,
i dont use dbgrids much ,i do use a free one but i use it for the memo feild as it has some properties i need.
i would sugest try
www.torry.ru etc that would be best place to start looking(or ask a questio here for 25 or so points asking if anyone knows of one..
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now