My Program has two forms From1 and Form2.
On From1 I have a TabControl1 witch has
8 tabs currently. I would like to add a new
tab from Form2 is this possible?
I have tried the following code on Form2
with no success:
Public MyFrom1 As New From1
Private Sub btnNewTab_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)Handles btnNewTab.Click
MyFrom1.TabPage1 = New TabPage
' Adds the tabPage1 to this collection.
MyFrom1.TabControl1.TabPages.Add(MyFrom1.TabPage1)
' Name the Tab
MyFrom1.TabPage1.Text = "myTabPage"
MyFrom1.TabControl1.Refresh()
End Sub
Thanks
Tom