如何在ok点击停止关闭弹出窗口 [英] how to stop closing the popup in ok click
问题描述
你好iam在弹出窗口中显示一个
windows窗体(DialogResult dlgResult = dlgabc.ShowDialog(this)
dlgabc表格有确定按钮.iam验证ok检查中的一些代码并给出关于验证的消息。当用户点击确定时,验证消息正在激活,弹出窗体将关闭,不允许用户更正弹出窗体中的文本。如何在ok单击中验证失败时停止关闭表单,并允许用户在弹出窗体的文本框中输入验证文本。
问候
Hi iam showing a
windows form in a popup (DialogResult dlgResult = dlgabc.ShowDialog(this)
dlgabc form is having ok button .iam validating some code in the ok check and giving message regarding the validation .when user click on ok the validation message is firing and the pop up form is getting closed and not allowing the user to correct the text in the popup form .how to restict the closing of the form when validation fails in the ok click and allow the user to enter the validate text in the text box of the popup form.
regards
推荐答案
设置 DialogResult [ ^ ]确定按钮的属性为无
,验证并且验证正常时,设置DialogResult
pr操作确定
。
Set DialogResult[^] property for OK button toNone
, validate and when validation is OK, setDialogResult
property toOK
.
这篇关于如何在ok点击停止关闭弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!