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?
 
rwilson032697Connect With a Mentor Commented:
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
 
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
keronAuthor Commented:
How can i do???
It really a trouble!!

rwilson
waiting for your Opinion!
:)
0
 
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
All Courses

From novice to tech pro — start learning today.