delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:


How can I accomplish that?


I'm trying to make a tabbed webbrowser and I need to create dynamic web browser components on each tab.
How can I accomplish that?

TOP

Browser := TWebBrowser.Create(TabSheetName); // Or Self instead of TabsheetName
Browser.Parent := TabSheetName;
Taht should do

TOP

TWebBrowser parent property is read-only
and I don't know how whether to use TTabControl or TPageControl
with TTabControl I have to draw an element inside a tab every tab onChange even happens.
TPageControl lets me add components during IDE but I cannot dinamically add more tabs
I'm suprised there isn't any tabbed webbrowser source code available...

TOP

TabSheet := TTabSheet.Create(PageControlName);
TabSheet.PageControl := PageControlName;
That's for adding the tabsheets dynamically.
As for the webbrowser, i have the code working with parent := control; and it does not say anything about read-only. Maybe in newer versions of delphi it is read only ...

TOP

abstract:


How can I accomplish that?


.parent is a ready-only property in delphi 2009
I found a solution:
Code:
  1. Browser := TWebBrowser.Create(TabSheet);
  2. TWinControl(Browser).Parent := TabSheet;
Copy Code
is this a good way to change current Tab Title?
Code:
  1. procedure OnDocumentComplete(Sender: TObject; const pDisp: IDispatch;var URL: OleVariant);
  2. begin
  3. (TWebBrowser(Sender).Parent as TTabSheet).caption := TWebBrowser(Sender).locationName;
  4. end;
Copy Code
get webbrowser from which the event was sent and then get the parent control of the webbrowser and change its title?

TOP

Don't see anything wrong with that. Probably could be done a hundred different ways, yours is just one of them ;]




How can I accomplish that?

TOP

Back Forum