if (!existed_channel.Contains(channel_name))
{
if (x)
{
tabpagex.BackColor = Color.Ivory;
tabControl1.TabPages.Add(tabpagex);
client_chat c = new client_chat(channel_name, owner); //Here the client_chat is my Winform that do all the chatting thing.
c.TopLevel = false;
c.Visible = true;
c.BackColor = Color.Ivory;
c.FormBorderStyle = FormBorderStyle.None;
c.Dock = DockStyle.Fill;
tabControl1.TabPages[tab_index].Controls.Add(c); //Here i fill up the tabpage with client_chat winform
tab_index++; //Increment the index everytime i add an tabpage.
existed_channel.Add(channel_name); //Add the name of the page to an arraylist, to make sure everytime there is no duplicate page
}
}
正如您所看到的,当我关闭其中一个Winform(在标签页上)时,我必须发回数据并修改tab_index。 我能够关闭Winform和tabpage,但是如何将数据发送回来却很困难。 我知道如何将数据从childForm发送回parentForm,但这里的情况略有不同。
答案 0 :(得分:0)
您可以在父级上使用所有控件都可以访问
的全局属性