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

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

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

        <tfoot id='an4Wm'></tfoot>
        <i id='an4Wm'><tr id='an4Wm'><dt id='an4Wm'><q id='an4Wm'><span id='an4Wm'><b id='an4Wm'><form id='an4Wm'><ins id='an4Wm'></ins><ul id='an4Wm'></ul><sub id='an4Wm'></sub></form><legend id='an4Wm'></legend><bdo id='an4Wm'><pre id='an4Wm'><center id='an4Wm'></center></pre></bdo></b><th id='an4Wm'></th></span></q></dt></tr></i><div id='an4Wm'><tfoot id='an4Wm'></tfoot><dl id='an4Wm'><fieldset id='an4Wm'></fieldset></dl></div>
      1. Windows 窗体中是否有内置确认对话框?

        Is there a builtin confirmation dialog in Windows Forms?(Windows 窗体中是否有内置确认对话框?)
              <tbody id='Gq1qZ'></tbody>

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

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

                • <bdo id='Gq1qZ'></bdo><ul id='Gq1qZ'></ul>
                  <legend id='Gq1qZ'><style id='Gq1qZ'><dir id='Gq1qZ'><q id='Gq1qZ'></q></dir></style></legend>
                  <tfoot id='Gq1qZ'></tfoot>
                • 本文介绍了Windows 窗体中是否有内置确认对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想创建一个简单的确认对话框,上面写着请检查信息,如果您确定信息正确,请单击确定."

                  I'd like to create a simple confirm dialog saying "Please check the information and if you're sure it's correct, click OK."

                  有这样的内置东西吗?

                  推荐答案

                  这里是一个例子.你可以试试这样的.

                  Here is an example. You can try something like this.

                  var confirmResult =  MessageBox.Show("Are you sure to delete this item ??",
                                                       "Confirm Delete!!",
                                                       MessageBoxButtons.YesNo);
                  if (confirmResult == DialogResult.Yes)
                  {
                      // If 'Yes', do something here.
                  }
                  else
                  {
                      // If 'No', do something here.
                  }
                  

                  您也可以尝试使用 MessageBoxButtons.OKCancel 代替 MessageBoxButtons.YesNo.这取决于您的要求.

                  You can also try MessageBoxButtons.OKCancel instead of MessageBoxButtons.YesNo. It depends on your requirements.

                  1. 如果您有 .Net Framework 4.6 或更高版本,请试试这个.

                  MessageBoxResult confirmResult = MessageBox.Show("Are you sure to delete this item ??", "Confirm Delete!!", MessageBoxButton.YesNo);`
                  
                  if (confirmResult == MessageBoxResult.Yes)
                  {
                     // If 'Yes', do something here.
                  }
                  else
                  {
                     // If 'No', do something here.
                  }
                  

                  这篇关于Windows 窗体中是否有内置确认对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)
                  Parameter count mismatch with Invoke?(参数计数与调用不匹配?)
                  How to store delegates in a List(如何将代表存储在列表中)
                  How delegates work (in the background)?(代表如何工作(在后台)?)
                  C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)
                  Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)

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

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

                        <tfoot id='c2EKo'></tfoot>

                        • <bdo id='c2EKo'></bdo><ul id='c2EKo'></ul>