Easy Question!! 200 Points!

I use a pagecontrol,and a tabsheet on it with a richedit on the tabsheet.

Now in my program I want to Make new
tabsheets on the pagecontrol,each one
have the save properties with the source
tabsheet,same width,same height,and
the same Event procedure such as Onchange and so on.

and each of the tabsheets are noninterference.

how can i do it???
keronAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rwilson032697Commented:
Here is how you add a new tab sheet:

TheTabSheet := TTabSheet.Create(Self);
TheTabSheet.Parent := ThePageControl;
TheTabSheet.PageControl := ThePageControl;
TheTabSheet.Caption := 'Editor';

And add a TRichEdit to it like this:

ARichEdit := TRichEdit.Create(Self);
ARichEdit.Parent := TheTabSheet;
ARichEdit.Align := alClient;
ARichEdit.OnChange := MyOnChangeHandler;
etc with the other properties.

In the events you can use the Sender parameter to distinguich between the RichEdits.

Cheers,

Raymond.
0
keronAuthor Commented:
o£¡
the problem had make a little change
I use Twebbrower (IE Brower Control)
to instead of richedit to display html files and text files.
but when I try your code ,
Delphi  said that the twebbrower's
parent property is read only.
How can I do it???

Thanks a lot !!!!
:)
0
keronAuthor Commented:
How can i do???
It really a trouble!!

rwilson
waiting for your Opinion!
:)
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

rwilson032697Commented:
This is how I insert a TWebBrowser control into a panel on a form:

    WebBrowser := TWebBrowser.Create(Self);
    WebBrowser.OnDocumentComplete := OnWebBrowserDocumentComplete;
    WebBrowser.OnBeforeNavigate2 := OnWebBrowserBeforeNavigate2;
    panel3.insertcontrol(Webbrowser);
    WebBrowser.Align := alClient;

If you subsitute MyTabSheet for Panel3 this code should work for you...

Cheers,

Raymond.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
XANCommented:
May be better create own class inherited from the TTabSheet with all necessary properties and then use this class in run-time for creation any number identical sheets?

  TMyTabSheet = class(TTabSheet)
  private
    FRichEdit: TRichEdit;
    ...
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    ...
  end;

  constructor TMyTabSheet.Create(AOwner: TComponent);
  begin
    inherited;
    FRichEdit := TRichEdit.Create(...);
    ...
  end;

and so on.
0
keronAuthor Commented:
I love you rwilson!!!!
:P
0
rwilson032697Commented:
:-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.