当复选框为true或false时,如何在文本框中显示是或否反映 [英] How do I make yes or no reflect in the textbox when the checkbox is true or false

查看:219
本文介绍了当复选框为true或false时,如何在文本框中显示是或否反映的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个代码,使文本框显示是或否取决于checkstate

这是我的代码,但当我没有运行任何显示在框中



我尝试过的事情:



 Private Sub furonly_TextChanged(sender As Object,e As EventArgs)处理furonly.TextChanged 
如果rdbtnfur.Checked = True则
furonly.Text =是
否则furonly.Text =否
结束If
End Sub

解决方案

此代码不应该在 CheckBox.CheckedChanged事件 [ ^ ]而不是Control.TextChanged事件(System.Windows.Forms) [ ^ ]

i have a code that makes the the text box show yes or no depending on the checkstate
this is the code i have but when i run nothing shows in the box

What I have tried:

Private Sub furonly_TextChanged(sender As Object, e As EventArgs) Handles furonly.TextChanged
       If rdbtnfur.Checked = True Then
           furonly.Text = "Yes"
       Else furonly.Text = "No"
       End If
   End Sub

解决方案

Shouldn't this code be in the CheckBox.CheckedChanged Event[^] instead of Control.TextChanged Event (System.Windows.Forms)[^]


这篇关于当复选框为true或false时,如何在文本框中显示是或否反映的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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