Hi, I have two forms. From form1(frmMain) I want to add tabpages to
Form2. In form1 I have:
frmMain tbe = new frmMain();
Thread thread = new Thread(new
ThreadStart(tbe.AddTab));
thread.IsBackground = true;
thread.Start();
In Form2 I have:
public delegate void mydata(String e);
public void AddTab()
{
if (this.InvokeRequired)
{
this.BeginInvoke(new mydata(TestMethod),"somestring");
}
else
{
TestMethod("rob");
}
}
private void TestMethod(String mystring)
{
String TabName = "rob";
TabPage NewTab = new TabPage(TabName);
tabControl1.TabPages.Add(NewTab);
}
It biulds ok, and runs ok, but doesnt show the tabs on Form2.
The idea is that both forms are open, from form one I scan through a
list which has been added to a treeview,(this all works). Then click
the item I want, creating a new tab in form2 each time. Then close
form1 and work with form2.
Regards Robert