Close Button For Tabbed Browsing

Web Browser using tab control

Page 1 of 1

3 Replies - 3152 Views - Last Post: 24 November 2008 - 08:39 AM Rate Topic: -----

#1 SlicedDrip  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 22-November 08

Close Button For Tabbed Browsing

Post icon  Posted 22 November 2008 - 03:47 PM

Hello all,

I am new to the form, and I am need of some help.

Real simple, but just wrap my fingers around it.

How do i get the close button on my tabs? Nothing I try helps me.

Oh yeah what is the code to close the current tab you are on?

Thanks in advance.

SlicedDrip
Is This A Good Question/Topic? 0
  • +

Replies To: Close Button For Tabbed Browsing

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Close Button For Tabbed Browsing

Posted 22 November 2008 - 07:13 PM

Are you using VB6 or a different version?

[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#3 SlicedDrip  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 22-November 08

Re: Close Button For Tabbed Browsing

Posted 23 November 2008 - 02:59 PM

I am using vb express 2008

I don't know where to start. My web browser is pretty much complete besides the closing tab part. Here is my code pretty much.

#Region "Tabs"
	Public Sub AddTab(ByRef URL As String, ByRef TabControl As TabControl)
		Dim NewBrowser As New CustomBrowser
		Dim NewTab As New TabPage
		NewBrowser.Tag = NewTab
		NewTab.Tag = NewBrowser
		TabControl.TabPages.Add(NewTab)
		NewTab.Controls.Add(NewBrowser)
		NewBrowser.Dock = DockStyle.Fill
		NewBrowser.Navigate(URL)
	End Sub
#End Region

#Region "CustomBrowser Navigation"
	Private Sub btnBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBack.Click
		Dim WB As CustomBrowser = Me.TabControl1.SelectedTab.Tag
		WB.GoBack()
	End Sub

	Private Sub btnForward_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnForward.Click
		Dim WB As CustomBrowser = Me.TabControl1.SelectedTab.Tag
		WB.GoForward()
	End Sub

	Private Sub btnRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefresh.Click
		Dim WB As CustomBrowser = Me.TabControl1.SelectedTab.Tag
		WB.Refresh()
	End Sub

	Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click
		Dim WB As CustomBrowser = Me.TabControl1.SelectedTab.Tag
		WB.Stop()
	End Sub

	Private Sub btnAddTab_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddTab.Click
		AddTab("about:blank", TabControl1)
	End Sub

	Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click
		GO()
	End Sub

Was This Post Helpful? 0
  • +
  • -

#4 SlicedDrip  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 22-November 08

Re: Close Button For Tabbed Browsing

Posted 24 November 2008 - 08:39 AM

oh yeah this isn't a homework assignment, this is for fun.

Thanks for all the help
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1