Hallo Leute …
Ich habe ein Problem das Folgendermaßen aussieht…
Ich möchte gerne wissen ob schon ein Tab in einem Tabcontrol vorhanden ist.
Wenn dieser Tab Vorhanden ist… Dann die in diesem Tab befindliche Textbox mit Text gefüllt werden.
Also wie mache ich das jetzt ?
Wie ich Überprüfe ob der Tab schon da ist weiß ich.
Aber die Sache ist die das ich Folgendermaßen immer einen Neuen Tab erstelle :
Public Shared Sub Taberstellen(ByVal TabName As String)
Dim tTab As New TabPage(TabName)
Dim tb, tb2 As New KryptonTextBox
Dim pb, pb1, pb2, pb3, pb4, pb5 As New PictureBox
Dim panel As New KryptonPanel
panel.Parent = tTab
tb.Parent = tTab
tb2.Parent = tTab
tTab.Controls.Add(panel) : tTab.Controls.Add(tb) : tTab.Controls.Add(tb2)
panel.Dock = DockStyle.Left
panel.Height = 268
panel.Width = 100
Dim panelloc As New System.Drawing.Point
panelloc.X = 3
panelloc.Y = 3
panel.Location = panelloc
'tb.Dock = DockStyle.Bottom
tb.Multiline = True
tb.Height = 92
tb.Width = 273
Dim tbloc As New System.Drawing.Point
tbloc.X = 103
tbloc.Y = 179
tb.Location = tbloc
'tb2.Dock = DockStyle.Bottom
tb2.ReadOnly = True
tb2.Multiline = True
tb2.Height = 176
tb2.Width = 273
Dim tb2loc As New System.Drawing.Point
tb2loc.X = 103
tb2loc.Y = 3
tb2.Location = tb2loc
pb.Parent = panel
pb.BorderStyle = BorderStyle.FixedSingle
pb.SizeMode = PictureBoxSizeMode.StretchImage
pb.BackColor = Color.Transparent
pb.Height = 92
pb.Width = 94
Dim pbloc As New System.Drawing.Point
pbloc.X = 3
pbloc.Y = 3
pb.Location = pbloc
pb1.Parent = panel
pb1.BorderStyle = BorderStyle.FixedSingle
pb1.Image = My.Resources.ResourceManager.GetObject(„benutzer“)
pb1.SizeMode = PictureBoxSizeMode.StretchImage
pb1.BackColor = Color.Transparent
pb1.Height = 16
pb1.Width = 16
Dim pb1loc As New System.Drawing.Point
pb1loc.X = 8
pb1loc.Y = 101
pb1.Location = pb1loc
pb2.Parent = panel
pb2.BorderStyle = BorderStyle.FixedSingle
pb2.Image = My.Resources.ResourceManager.GetObject(„pref-ft“)
pb2.SizeMode = PictureBoxSizeMode.StretchImage
pb2.BackColor = Color.Transparent
pb2.Height = 16
pb2.Width = 16
Dim pb2loc As New System.Drawing.Point
pb2loc.X = 30
pb2loc.Y = 101
pb2.Location = pb2loc
pb3.Parent = panel
pb3.BorderStyle = BorderStyle.FixedSingle
pb3.Image = My.Resources.ResourceManager.GetObject(„E-Mail-32“)
pb3.SizeMode = PictureBoxSizeMode.StretchImage
pb3.BackColor = Color.Transparent
pb3.Height = 16
pb3.Width = 16
Dim pb3loc As New System.Drawing.Point
pb3loc.X = 52
pb3loc.Y = 101
pb3.Location = pb3loc
pb4.Parent = panel
pb4.BorderStyle = BorderStyle.FixedSingle
pb4.Image = My.Resources.ResourceManager.GetObject(„Contact-32“)
pb4.SizeMode = PictureBoxSizeMode.StretchImage
pb4.BackColor = Color.Transparent
pb4.Height = 16
pb4.Width = 16
Dim pb4loc As New System.Drawing.Point
pb4loc.X = 74
pb4loc.Y = 101
pb4.Location = pb4loc
pb5.Parent = panel
pb5.BorderStyle = BorderStyle.FixedSingle
pb5.SizeMode = PictureBoxSizeMode.StretchImage
pb5.BackColor = Color.Transparent
pb5.Height = 92
pb5.Width = 94
Dim pb5loc As New System.Drawing.Point
pb5loc.X = 3
pb5loc.Y = 171
pb5.Location = pb5loc
frm_private.TabControl1.TabPages.Add(tTab)
End Sub
Wie kann ich jetzt auf die Textbox zugreifen die im Jeweiligen Tab liegt ?