Vaildating单选按钮。 [英] Vaildating radio buttons.

查看:84
本文介绍了Vaildating单选按钮。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我有以下代码

Hi all

I have the following code

//status selection
              string option1 = "";
              if (radIn.Checked == true)
              {
                  option1 = radIn.Text;

              }
              else if (radOut.Checked == true)
              {
                  option1 = radOut.Text;

              }



-此代码选择用户检查为状态的任何选项(进/出)..现在我要验证用户在签入之前检查(即必须首先选择radOut),反之亦然。知道我该如何做到这一点?谢谢


-this code selects whatever option the user checks as status (in/out).. now i want to validate that the user checks out(i.e. must first select radOut) before checking in and vice versa.. Know how i can go about doing that? thanks

推荐答案

您应该选择 RadioButton.Checked属性 [ ^ ]您的单选按钮应用默认选择。
You should select RadioButton.Checked Property[^] of your radio button to apply default select.


试试这个: MSDN [ ^ ]:)


这篇关于Vaildating单选按钮。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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