Hello everyone!
I'm new here, and I'm trying to find the awnser to my question already for a few hours, I tried to search didn't find anything at all...
So now I'm here.
I'm trying to make an application where you can search trough a database and then return the values. At the moment is what I am trying to do is changing my mainTab Control by a child form (Main form opens Search form, and the Search form has to be able to change the mainTab Control on the Main form)
Does anyone know how you can do this?
At the moment I have this:
Employee ret = new Employee();
Main mn = new Main();
ret.EmpID = empID;
ret.TopLevel = false;
ret.Parent = this;
if (Int32.Parse(ConfigurationManager.AppSettings["useTabs"]) == 1)
{
ret.Dock = DockStyle.Fill;
ret.FormBorderStyle = FormBorderStyle.None;
TabPage newTab = new TabPage("Tesfghfghfghfghfhgfghfghfghfght");
newTab.Controls.Add(ret);
mn.mainTab.TabPages.Add(newTab);
mn.mainTab.SelectedTab = mn.mainTab.TabPages[mn.mainTab.TabPages.Count - 1];
mn.Refresh();
this.Parent.Controls.Add(ret);
}
else
{
mn.mainPanel.Controls.Add(ret);
}
ret.Show();
But that don't think that is working because I'm creating a new Main, while it should change on the Main which is already there.
Kind Regards,