Windows窗体显示空白文本框错误 [英] windows forms display the blank text box error

查看:81
本文介绍了Windows窗体显示空白文本框错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在测试中显示错误,如果我的两个文本框在winform上为空.
我不知道mbox是否是更好的选择.所以我可以使用气球显示错误消息还是有其他更好的方法来做到这一点.

i want to display an error on testing if my two textboxes are empty on winform.
I dont know if the mbox is an better option .so can i use the balloon for the display of error message or there is some other better method to do that .

推荐答案

尝试回答这是一个奇怪的问题-这取决于您要检查的时间以及要发生的事情.
通常,您将检查他们何时按下OK按钮或类似按钮(或者更好的是,禁用OK按钮,直到输入有效).

但是,如果这样做,那么显示一条消息就意味着取消OK动作-这并不困难,但是可能出乎意料且令人生厌.

您想通过支票实现什么?您什么时候需要使用它?它有多关键?它应该打乱用户输入吗?所有这些取决于您的表单将用于什么:如果是数据输入,那么最后的错误会更友好,因为数据输入工作人员在输入数据时不会看屏幕.依此类推.
It''s a odd question to try and answer - it depends on when you want to check, and what you want to happen.
Normally, you would check when they press the OK button or similar (or better, disable the OK button until the entries are valid)

But, if you do that then showing a message means cancelling the OK action - which isn''t difficult, but can be unexpected, and intrusive.

What are you trying to achieve with the check? When do you need to apply it? How critical is it? Should it disrupt the user input? All these things depend on what your form will be used for: if it is data entry, then errors at the end can be more friendly, since data entry workers don''t look at the screen when they enter data. And so on.


这篇关于Windows窗体显示空白文本框错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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