By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,940 Members | 1,300 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,940 IT Pros & Developers. It's quick & easy.

tabpage(s) with webbrowser

P: n/a
I have a tab control in a which a few of the tabs include an AxWebBrowser browser control. Let say i have currently tabpage2 and i typed url in combobox when i pressed enter it doesn't display webbrowser instead i can do create new tab. ne one knows how to display currrently displayed regardless of tabpage(s)?
here is code:
Public Sub AddBrowserTab()
AxWebBrowser1.Visible = False
Dim newPage As TabPage = New TabPage(Text) ' Delcare and create the tab page
Dim browser As AxSHDocVw.AxWebBrowser = New AxSHDocVw.AxWebBrowser ' Declare and create the browser(control)
newPage = New TabPage(Text)
browser = New AxSHDocVw.AxWebBrowser
newPage.Controls.Add(browser) ' Add the browser to the tab(page)
browser.Dock = DockStyle.Fill ' Fill the tab page withit.
browser.Enabled = True ' Enable it

TabControl1.TabPages.Add(newPage) ' Add the tab page to the tab control
TabControl1.Visible = True

browser.Navigate2(cboAddress.Text)
browser.Silent = False
newPage.ToolTipText = Text

Debug.WriteLine("NP :" & newPage.TabIndex)
Debug.WriteLine("Name :" & newPage.Text.ToString())
' browser.Navigate2("about:blank") ' Set initial page to blank()
cboAddress.Text = String.Empty
End Sub

Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Supra,

I made a form with a tabcontrol with two tabpages on it.
Dragged to both a button
Dragged to both a axwebbrowser

It works exactly as I expected.

Until now I never saw somebody in this newsgroups who succeeded to use the
axwebbrowser without draging it on a form (not that I say that it is
impossible however it will be probably a lot of work and dragging does all
the settings in the RESX)

I hope this helps?

Cor
"Supra" <su*****@rogers.com>
I have a tab control in a which a few of the tabs include an AxWebBrowser
browser control. Let say i have currently tabpage2 and i typed url in
combobox when i pressed enter it doesn't display webbrowser instead i can
do create new tab. ne one knows how to display currrently displayed
regardless of tabpage(s)?
here is code:
Public Sub AddBrowserTab()
AxWebBrowser1.Visible = False
Dim newPage As TabPage = New TabPage(Text) ' Delcare and create
the tab page
Dim browser As AxSHDocVw.AxWebBrowser = New AxSHDocVw.AxWebBrowser
' Declare and create the browser(control)
newPage = New TabPage(Text)
browser = New AxSHDocVw.AxWebBrowser
newPage.Controls.Add(browser) ' Add the browser to the
tab(page)
browser.Dock = DockStyle.Fill ' Fill the tab page
withit.
browser.Enabled = True ' Enable it

TabControl1.TabPages.Add(newPage) ' Add the tab page to the
tab control
TabControl1.Visible = True

browser.Navigate2(cboAddress.Text)
browser.Silent = False
newPage.ToolTipText = Text
Debug.WriteLine("NP :" & newPage.TabIndex)
Debug.WriteLine("Name :" & newPage.Text.ToString())
' browser.Navigate2("about:blank") ' Set initial page to
blank()
cboAddress.Text = String.Empty
End Sub

Nov 21 '05 #2

P: n/a
do u have code to send me so i can take a look at it and see how it works?
Cor Ligthert wrote:
Supra,

I made a form with a tabcontrol with two tabpages on it.
Dragged to both a button
Dragged to both a axwebbrowser

It works exactly as I expected.

Until now I never saw somebody in this newsgroups who succeeded to use the
axwebbrowser without draging it on a form (not that I say that it is
impossible however it will be probably a lot of work and dragging does all
the settings in the RESX)

I hope this helps?

Cor
"Supra" <su*****@rogers.com>
I have a tab control in a which a few of the tabs include an AxWebBrowser
browser control. Let say i have currently tabpage2 and i typed url in
combobox when i pressed enter it doesn't display webbrowser instead i can
do create new tab. ne one knows how to display currrently displayed
regardless of tabpage(s)?
here is code:
Public Sub AddBrowserTab()
AxWebBrowser1.Visible = False
Dim newPage As TabPage = New TabPage(Text) ' Delcare and create
the tab page
Dim browser As AxSHDocVw.AxWebBrowser = New AxSHDocVw.AxWebBrowser
' Declare and create the browser(control)
newPage = New TabPage(Text)
browser = New AxSHDocVw.AxWebBrowser
newPage.Controls.Add(browser) ' Add the browser to the
tab(page)
browser.Dock = DockStyle.Fill ' Fill the tab page
withit.
browser.Enabled = True ' Enable it

TabControl1.TabPages.Add(newPage) ' Add the tab page to the
tab control
TabControl1.Visible = True

browser.Navigate2(cboAddress.Text)
browser.Silent = False
newPage.ToolTipText = Text
Debug.WriteLine("NP :" & newPage.TabIndex)
Debug.WriteLine("Name :" & newPage.Text.ToString())
' browser.Navigate2("about:blank") ' Set initial page to
blank()
cboAddress.Text = String.Empty
End Sub



Nov 21 '05 #3

P: n/a
Supra,

That needs almost no code.
When the axwebbrowser is not in your toolbox

Open the toolbox rightclick on, choose Com and check the checkbox Microsoft Webbrowser

Create a new form and drag to that a tabcontrol
Create in that 2 tabpages
Drag on every tabpage a button
Drag on every tabpage an axwebbrowser from your toolbox
Click on the two buttons to create events from both
Set in those
Me.AxWebBrowser1.Navigate2("www.google.com")
And
Me.AxWebBrowser1.Navigate2("msdn.microsoft.com")

Sample ready

I hope this helps?

Cor
"Supra" <su*****@rogers.com>

do u have code to send me so i can take a look at it and see how it works?
Cor Ligthert wrote:

Supra,

I made a form with a tabcontrol with two tabpages on it.
Dragged to both a button
Dragged to both a axwebbrowser

It works exactly as I expected.

Until now I never saw somebody in this newsgroups who succeeded to use the
axwebbrowser without draging it on a form (not that I say that it is
impossible however it will be probably a lot of work and dragging does all
the settings in the RESX)

I hope this helps?

Cor
"Supra" <su*****@rogers.com>

I have a tab control in a which a few of the tabs include an AxWebBrowser
browser control. Let say i have currently tabpage2 and i typed url in
combobox when i pressed enter it doesn't display webbrowser instead i can
do create new tab. ne one knows how to display currrently displayed
regardless of tabpage(s)?
here is code:
Public Sub AddBrowserTab()
AxWebBrowser1.Visible = False
Dim newPage As TabPage = New TabPage(Text) ' Delcare and create
the tab page
Dim browser As AxSHDocVw.AxWebBrowser = New AxSHDocVw.AxWebBrowser
' Declare and create the browser(control)
newPage = New TabPage(Text)
browser = New AxSHDocVw.AxWebBrowser
newPage.Controls.Add(browser) ' Add the browser to the
tab(page)
browser.Dock = DockStyle.Fill ' Fill the tab page
withit.
browser.Enabled = True ' Enable it

TabControl1.TabPages.Add(newPage) ' Add the tab page to the
tab control
TabControl1.Visible = True

browser.Navigate2(cboAddress.Text)
browser.Silent = False
newPage.ToolTipText = Text
Debug.WriteLine("NP :" & newPage.TabIndex)
Debug.WriteLine("Name :" & newPage.Text.ToString())
' browser.Navigate2("about:blank") ' Set initial page to
blank()
cboAddress.Text = String.Empty
End Sub


Nov 21 '05 #4

P: n/a
thank!

Cor Ligthert wrote:
Supra,

That needs almost no code.
When the axwebbrowser is not in your toolbox

Open the toolbox rightclick on, choose Com and check the checkbox
Microsoft Webbrowser

Create a new form and drag to that a tabcontrol
Create in that 2 tabpages
Drag on every tabpage a button
Drag on every tabpage an axwebbrowser from your toolbox
Click on the two buttons to create events from both
Set in those
Me.AxWebBrowser1.Navigate2("www.google.com <http://www.google.com>")
And
Me.AxWebBrowser1.Navigate2("msdn.microsoft.com <http://www.google.com>")

Sample ready

I hope this helps?

Cor

"Supra" <su*****@rogers.com <mailto:su*****@rogers.com>>

do u have code to send me so i can take a look at it and see how
it works?
Cor Ligthert wrote:
Supra,

I made a form with a tabcontrol with two tabpages on it.
Dragged to both a button
Dragged to both a axwebbrowser

It works exactly as I expected.

Until now I never saw somebody in this newsgroups who succeeded to use the
axwebbrowser without draging it on a form (not that I say that it is
impossible however it will be probably a lot of work and dragging does all
the settings in the RESX)

I hope this helps?

Cor
"Supra" <su*****@rogers.com>
I have a tab control in a which a few of the tabs include an AxWebBrowser
browser control. Let say i have currently tabpage2 and i typed url in
combobox when i pressed enter it doesn't display webbrowser instead i can
do create new tab. ne one knows how to display currrently displayed
regardless of tabpage(s)?
here is code:
Public Sub AddBrowserTab()
AxWebBrowser1.Visible = False
Dim newPage As TabPage = New TabPage(Text) ' Delcare and create
the tab page
Dim browser As AxSHDocVw.AxWebBrowser = New AxSHDocVw.AxWebBrowser
' Declare and create the browser(control)
newPage = New TabPage(Text)
browser = New AxSHDocVw.AxWebBrowser
newPage.Controls.Add(browser) ' Add the browser to the
tab(page)
browser.Dock = DockStyle.Fill ' Fill the tab page
withit.
browser.Enabled = True ' Enable it

TabControl1.TabPages.Add(newPage) ' Add the tab page to the
tab control
TabControl1.Visible = True

browser.Navigate2(cboAddress.Text)
browser.Silent = False
newPage.ToolTipText = Text
Debug.WriteLine("NP :" & newPage.TabIndex)
Debug.WriteLine("Name :" & newPage.Text.ToString())
' browser.Navigate2("about:blank") ' Set initial page to
blank()
cboAddress.Text = String.Empty
End Sub



Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.