• <legend id='y8EmX'><style id='y8EmX'><dir id='y8EmX'><q id='y8EmX'></q></dir></style></legend>

        • <bdo id='y8EmX'></bdo><ul id='y8EmX'></ul>
        <tfoot id='y8EmX'></tfoot>

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

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

        在 Winforms 中控制用户工作流程

        时间:2023-06-04
        • <bdo id='REDA1'></bdo><ul id='REDA1'></ul>

              <legend id='REDA1'><style id='REDA1'><dir id='REDA1'><q id='REDA1'></q></dir></style></legend>

                    <tbody id='REDA1'></tbody>

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

                  <tfoot id='REDA1'></tfoot>
                • <i id='REDA1'><tr id='REDA1'><dt id='REDA1'><q id='REDA1'><span id='REDA1'><b id='REDA1'><form id='REDA1'><ins id='REDA1'></ins><ul id='REDA1'></ul><sub id='REDA1'></sub></form><legend id='REDA1'></legend><bdo id='REDA1'><pre id='REDA1'><center id='REDA1'></center></pre></bdo></b><th id='REDA1'></th></span></q></dt></tr></i><div id='REDA1'><tfoot id='REDA1'></tfoot><dl id='REDA1'><fieldset id='REDA1'></fieldset></dl></div>
                • 本文介绍了在 Winforms 中控制用户工作流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在用 C# 构建一个 Winforms 应用程序,并且我添加了一个具有三个选项卡的选项卡控件.

                  I'm building a Winforms application in C# and I have added a tab control that has three tabs.

                  我想限制用户访问第二个标签页的能力,直到用户填写第一个标签页.

                  I want to restrict user's ability to access the second tab page until user fills out the first tab.

                  我在第一个选项卡上有一个提交按钮,我希望在用户单击 submit 按钮时能够访问第二个选项卡.

                  I have a submit button the first tab, I want the second tab to be able to be accessed when the user clicks on the submit button.

                  我怎样才能做到这一点?

                  How can I accomplish this?

                  图片不可用

                  推荐答案

                  阻止用户选择选项卡会导致用户界面非常不直观.考虑创建一个向导",这是一个 UI 小工具,可通过下一步"按钮将用户从一个页面带到下一个页面.和一个后退按钮,可选.您可以通过设置 Next 按钮的 Enabled 属性来明确一个步骤已完成.

                  Preventing a user from selecting a tab makes for a very unintuitive user interface. Consider creating a "wizard", a UI gadget that takes the user from one page to the next with a Next button. And a Back button, optional. You can make it clear that a step is completed by setting the Next button's Enabled property.

                  可以使用 TabControl 创建这样的向导.向您的项目添加一个新类并粘贴如下所示的代码.编译.将新控件从工具箱顶部拖放到表单上.在设计时,它看起来像一个普通的 TC,允许您添加每个向导步骤所需的控件.在运行时选项卡是隐藏的.实现 Next 和 Back 按钮很简单,只需更改 SelectedIndex 属性即可.

                  Creating such a wizard can be done with a TabControl. Add a new class to your project and paste the code shown below. Compile. Drop the new control from the top of the toolbox onto your form. At design time it looks like a normal TC, allowing you to add the controls needed for each wizard step. At runtime the tabs are hidden. Implementing the Next and Back buttons is simple, just change the SelectedIndex property.

                  using System;
                  using System.Windows.Forms;
                  
                  class WizardPages : TabControl {
                    protected override void WndProc(ref Message m) {
                      // Hide tabs by trapping the TCM_ADJUSTRECT message
                      if (m.Msg == 0x1328 && !DesignMode) m.Result = (IntPtr)1;
                      else base.WndProc(ref m);
                    }
                  }
                  

                  这篇关于在 Winforms 中控制用户工作流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:字符串到字节[],反之亦然? 下一篇:如何从 chrome 获取打开的标签列表?|C#

                  相关文章

                  最新文章

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

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

                    <legend id='ytxSL'><style id='ytxSL'><dir id='ytxSL'><q id='ytxSL'></q></dir></style></legend>