I am trying to figure out how to change the tab selected in a tabcontrol and tell the program which tab to select based on its' name. The problem is that the tab would be added programmatically in runtime. The error report says
"Value of type 'String' cannot be converted to 'System.Windows.Forms.TabPage'. "
What can I do?
BTW, I failed to mention this in my last post. I know I went on a long hiatus. I was designing someone's website with flash cs5.Code:Private Sub CatBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CatBtn1.Click TC2.SelectedTab = Me.Text End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click y = y + 24 Dim NTP As New TabPage() TC2.Controls.Add(NTP) NTP.Width = 75 Dim NCB As New CatBtn() NCB.Location = New Point(0, y) Panel1.Controls.Add(NCB) Dim NLV As New ListView() NLV.Dock = DockStyle.Fill NLV.Items.Add("item 1") NLV.Items.Add("item 2") Label2.Text = y NTP.Text = TextBox2.Text NCB.Text = TextBox2.Text TextBox2.Text = "" End Sub


Reply With Quote


Good job !

Bookmarks