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

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

      2. 更改带有选项卡的接受按钮

        时间:2023-06-04
      3. <legend id='QthoI'><style id='QthoI'><dir id='QthoI'><q id='QthoI'></q></dir></style></legend>

          <tbody id='QthoI'></tbody>
          <tfoot id='QthoI'></tfoot>

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

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

                1. 本文介绍了更改带有选项卡的接受按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我有一个用 C# 编写的 Windows 窗体应用程序,它有三个选项卡,我想用活动选项卡更改接受按钮.就像当我在标签 1 中时,我希望按钮 _1 成为接受按钮,但是当我在标签 3 中时,我希望 button_3 成为我的接受按钮.我无法弄清楚如何做到这一点,也许我在搜索中没有使用正确的术语,但我在网上找不到任何好的资源来告诉我如何做到这一点.

                  I have a windows form application written in C# and it has three tabs and I would like the accept button change with the active tab. Like When I am in tab 1 I want button _1 to be the accept button but when I am in tab 3 I want button_3 to be my accept button. I cannot figure out how to do this and maybe I'm not using the correct terms in my searches but I cannot find any good resources online showing me how to do this.

                  推荐答案

                  最好的猜测是连接到 SelectedIndexChanged 选项卡控件上的事件并更改 AcceptButton 取决于选择的选项卡.伪代码:

                  Best guess would be to hook in to the SelectedIndexChanged event on the tab control and change the AcceptButton depending on which tab is selected. Pseudo-code:

                  Form_OnLoad(...)
                  {
                      this.tabControl.SelectedIndexChanged += (s,e) => {
                          TabControl tab = s as TabControl;
                          switch (tab.SelectedIndex){
                              case 3:
                                  this.AcceptButton = this.button_3;
                                  break;
                              case 2:
                                  this.AcceptButton = this.button_2;
                                  break;
                              case 1:
                              default:
                                  this.AcceptButton = this.button_1;
                                  break;
                          }
                      };
                  }
                  

                  或者类似的东西.

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

                  上一篇:WPF TabControl On SelectionChanged,将焦点设置到文本字 下一篇:如何在 C# 中执行按住 ALT+TAB 发送键事件

                  相关文章

                  最新文章

                  <tfoot id='GzCUI'></tfoot>
                  1. <legend id='GzCUI'><style id='GzCUI'><dir id='GzCUI'><q id='GzCUI'></q></dir></style></legend>

                      <bdo id='GzCUI'></bdo><ul id='GzCUI'></ul>

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

                    1. <i id='GzCUI'><tr id='GzCUI'><dt id='GzCUI'><q id='GzCUI'><span id='GzCUI'><b id='GzCUI'><form id='GzCUI'><ins id='GzCUI'></ins><ul id='GzCUI'></ul><sub id='GzCUI'></sub></form><legend id='GzCUI'></legend><bdo id='GzCUI'><pre id='GzCUI'><center id='GzCUI'></center></pre></bdo></b><th id='GzCUI'></th></span></q></dt></tr></i><div id='GzCUI'><tfoot id='GzCUI'></tfoot><dl id='GzCUI'><fieldset id='GzCUI'></fieldset></dl></div>