我怎样才能在文本框中只写true或false? [英] how can i write only true or false in textbox?
本文介绍了我怎样才能在文本框中只写true或false?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只想在文本框中写true或false
i want to write in textbox only true or false
how can ı do that?
推荐答案
是的,可以,但是您可能需要执行它? :-) 不要这样做!这很难做到,几乎是不可能的.更重要的是,它将使您的用户感到意外.
同时,真正的解决方案是正确的UI设计.使用以下替代方法:
- 使用两个单选按钮是同一单选组:一个为"False",另一个为"True";它们将在互斥的基础上进行检查;
- 使用带有两个列表项的组合框:一个为"False",另一个为"True";
- 与以前相同,但使用列表框.
Yes you can but you probably need to enforce it? :-) Don''t do it! This is hard to do, nearly impossible; more importantly, it will confuse your user beyond all expectations.
At the same time, the real solution is the right UI design. Use the following alternatives:
- Use two radio buttons is the same radio group: one "False", another one "True"; they will be checked on mutually-exclusive basis;
- Use a combo box with two list items: one "False", another one "True";
- Same as before, but use a list box.
验证文本框文本,使其在Lostfocus()函数上仅具有"True or False".
Validate the textbox text such that it shoud have only "True or False" at lostfocus() function.
这篇关于我怎样才能在文本框中只写true或false?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文