<small id='0X9xX'></small><noframes id='0X9xX'>

<tfoot id='0X9xX'></tfoot>
      1. <i id='0X9xX'><tr id='0X9xX'><dt id='0X9xX'><q id='0X9xX'><span id='0X9xX'><b id='0X9xX'><form id='0X9xX'><ins id='0X9xX'></ins><ul id='0X9xX'></ul><sub id='0X9xX'></sub></form><legend id='0X9xX'></legend><bdo id='0X9xX'><pre id='0X9xX'><center id='0X9xX'></center></pre></bdo></b><th id='0X9xX'></th></span></q></dt></tr></i><div id='0X9xX'><tfoot id='0X9xX'></tfoot><dl id='0X9xX'><fieldset id='0X9xX'></fieldset></dl></div>
        • <bdo id='0X9xX'></bdo><ul id='0X9xX'></ul>
      2. <legend id='0X9xX'><style id='0X9xX'><dir id='0X9xX'><q id='0X9xX'></q></dir></style></legend>

        复制 TabControl 选项卡

        时间:2023-06-04

                <bdo id='jboRz'></bdo><ul id='jboRz'></ul>
              • <legend id='jboRz'><style id='jboRz'><dir id='jboRz'><q id='jboRz'></q></dir></style></legend>
              • <i id='jboRz'><tr id='jboRz'><dt id='jboRz'><q id='jboRz'><span id='jboRz'><b id='jboRz'><form id='jboRz'><ins id='jboRz'></ins><ul id='jboRz'></ul><sub id='jboRz'></sub></form><legend id='jboRz'></legend><bdo id='jboRz'><pre id='jboRz'><center id='jboRz'></center></pre></bdo></b><th id='jboRz'></th></span></q></dt></tr></i><div id='jboRz'><tfoot id='jboRz'></tfoot><dl id='jboRz'><fieldset id='jboRz'></fieldset></dl></div>
              • <tfoot id='jboRz'></tfoot>
                    <tbody id='jboRz'></tbody>

                  <small id='jboRz'></small><noframes id='jboRz'>

                  本文介绍了复制 TabControl 选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我在互联网上搜索了这个,但我找不到如何使用 C# 来完成它

                  I searched the internet for this but i couldn't find how to do it with C#

                  我想要做的是,当我点击我的 NewTab 按钮时,会出现一个新标签,其中包含与第一个标签上相同的控件.我看到了一些关于如何将 UserControl 添加到表单的信息,但 C# 没有类似的东西.

                  What i am trying to do is make it so that when i click on my NewTab button, a new tab appears with the same controls that were on the first tab. I saw some information on how to add a UserControl to your form, but C# doesn't have anything like that.

                  对于每个会说发布你的代码"的人,我没有,所以不要费心这么说,我唯一的代码是程序的代码,这对任何人都没有帮助.

                  And for everyone who would say "Post your code", i don't have any, so don't bother saying that, the only code i have is the code for the program and that wouldn't help anyone.

                  推荐答案

                  编辑

                  我已经重写了使用反射的解决方案.

                  EDIT

                  I have rewritten my solution to use reflection.

                  using System.Reflection;
                  
                  // your TabControl will be defined in your designer
                  TabControl tc;
                  // as will your original TabPage
                  TabPage tpOld = tc.SelectedTab;
                  
                  TabPage tpNew = new TabPage();
                  foreach(Control c in tpOld.Controls)
                  {
                      Control cNew = (Control) Activator.CreateInstance(c.GetType());
                  
                      PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(c);
                  
                      foreach (PropertyDescriptor entry in pdc)
                      {
                          object val = entry.GetValue(c);
                          entry.SetValue(cNew, val);
                      }
                  
                      // add control to new TabPage
                      tpNew.Controls.Add(cNew);
                  }
                  
                  tc.TabPages.Add(tpNew);
                  

                  一些信息可以在这里找到.http://www.codeproject.com/Articles/12976/How-to-Clone-Serialize-Copy-Paste-a-Windows-Forms

                  Some information can be found here. http://www.codeproject.com/Articles/12976/How-to-Clone-Serialize-Copy-Paste-a-Windows-Forms

                  这篇关于复制 TabControl 选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何从 chrome 获取打开的标签列表?|C# 下一篇:在 WebBrowser 控件的新选项卡中打开新网页

                  相关文章

                  最新文章

                    <legend id='Rq8p9'><style id='Rq8p9'><dir id='Rq8p9'><q id='Rq8p9'></q></dir></style></legend>
                      <i id='Rq8p9'><tr id='Rq8p9'><dt id='Rq8p9'><q id='Rq8p9'><span id='Rq8p9'><b id='Rq8p9'><form id='Rq8p9'><ins id='Rq8p9'></ins><ul id='Rq8p9'></ul><sub id='Rq8p9'></sub></form><legend id='Rq8p9'></legend><bdo id='Rq8p9'><pre id='Rq8p9'><center id='Rq8p9'></center></pre></bdo></b><th id='Rq8p9'></th></span></q></dt></tr></i><div id='Rq8p9'><tfoot id='Rq8p9'></tfoot><dl id='Rq8p9'><fieldset id='Rq8p9'></fieldset></dl></div>
                      • <bdo id='Rq8p9'></bdo><ul id='Rq8p9'></ul>

                    1. <small id='Rq8p9'></small><noframes id='Rq8p9'>

                      <tfoot id='Rq8p9'></tfoot>