如何在ok点击停止关闭弹出窗口 [英] how to stop closing the popup in ok click

查看:118
本文介绍了如何在ok点击停止关闭弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好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 to None, validate and when validation is OK, set DialogResult property to OK.


这篇关于如何在ok点击停止关闭弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆