codGmer
Gebruiker
- Lid geworden
- 8 mei 2010
- Berichten
- 649
Ik heb nu gemaakt dat als je een nieuwe tabpagina maakt met de button de controls van de bestaande tabs gecopieërd worden naar de nieuwe tab alleen als ik de 2de nieuwe tab toevoeg(dus voor de 2de keer een nieuwe tab aanmaken) dan gaat de control weg van de 1ste nieuwe en de 2de nieuwe tab.
Code:
Public Class Form1
Dim j As New WebBrowser
Dim w As New TabPage
Dim pic As New PictureBox
Dim ee As New PictureBox
Dim aa As New PictureBox
Dim dd As New PictureBox
Dim ff As New PictureBox
Code:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
AddHandler pic.Click, AddressOf pic_Click
AddHandler ee.Click, AddressOf ee_Click
AddHandler aa.Click, AddressOf aa_Click
AddHandler dd.Click, AddressOf dd_click
AddHandler ff.Click, AddressOf ff_click
AddHandler j.NewWindow, AddressOf j_newwindow
ff.Location = New Point(174, 4)
ff.Size = New Size(25, 23)
ff.Image = My.Resources._1307020348_home
ff.SizeMode = PictureBoxSizeMode.StretchImage
dd.Location = New Point(142, 1)
dd.Size = New Size(26, 26)
dd.Image = My.Resources._1307467770_stop
dd.SizeMode = PictureBoxSizeMode.Zoom
ee.Location = New Point(67, 4)
ee.Size = New Size(32, 23)
ee.Image = My.Resources._1307020281_arrowright
aa.Location = New Point(105, 5)
aa.Size = New Size(31, 22)
aa.Image = My.Resources._1307020182_refresh
aa.SizeMode = PictureBoxSizeMode.Zoom
pic.Location = New Point(35, 3)
pic.Size = New Size(35, 24)
pic.Image = My.Resources._1307020232_arrowleft
j.ScriptErrorsSuppressed = True
Hviewer.TabControl1.TabPages.Add(w)
w.Controls.Add(pic)
w.Controls.Add(ee)
w.Controls.Add(aa)
w.Controls.Add(dd)
w.Controls.Add(ff)
w.Controls.Add(j)
j.Location = New Point(-4, 27)
j.Size = New Size(1172, 619)
j.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right) Or System.Windows.Forms.AnchorStyles.Bottom
j.Navigate(TextBox2.Text)
ListBox1.Items.Clear()
For Each item In Hviewer.TabControl1.TabPages
ListBox1.Items.Add(item.text)
Next
End Sub
Code:
Private Sub pic_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim pic As PictureBox = DirectCast(sender, PictureBox)
j.GoBack()
End Sub
Private Sub ee_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim ee As PictureBox = DirectCast(sender, PictureBox)
j.GoForward()
End Sub
Private Sub aa_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim aa As PictureBox = DirectCast(sender, PictureBox)
j.Refresh()
End Sub
Private Sub dd_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim dd As PictureBox = DirectCast(sender, PictureBox)
j.Stop()
End Sub
Private Sub ff_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim ff As PictureBox = DirectCast(sender, PictureBox)
j.Navigate(My.Settings.startpage)
End Sub
Private Sub j_newwindow(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
Dim j As WebBrowser = DirectCast(sender, WebBrowser)
e.cancel = True
j.Navigate(j.StatusText)
End Sub
Laatst bewerkt: