本文介绍了如何清除单选按钮而不删除“点”按钮形式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 你好,我正在做一个项目,我需要一些帮助。 i创建了一个按钮,干净 在这个按钮中我把这个验证,下面.. Private Sub cleanbt_Click(sender As System.Object,e As System.EventArgs)处理cleanbt.Click >如果rbbut_company.Checked那么 >> rbbut_company.Checked = False > ElseIf rdbut_compind.Checked Then >> rdbut_compind.Checked = False > ElseIf rbbut_indi.Checked Then >> rbbut_indi.Checked = False >结束如果 我的问题是,当我选择一个单选按钮,公司或任何其他时,通过单击清除按钮他清理所有,并生活任何已检查的单选按钮.. 这是一个了解我的问题的例子: 当我启动程序时,首先选择的是名称: name.radiobutton * nickname.radiobutton telefon.radiobutton email.radiobutton 我选择另一个术语是不同的: name.radiobutton nickname.radiobutton telefon.radiobutton * email.radiobutton 当我点击清洁时,他应该返回并选择第一次,当我启动程序时,名称。 像这样: name.radiobutton * nickname.radiobutton telefon.radiobutton email.radiobutton 但是问题是:他清理一切, 但我不想要那个。 = / 喜欢这样: nome.radiobutton apelido.radiobutton telefone.radiobutton email.radiobutton 没有选中 i想回去选择,就像我第一次启动程序时的名字一样。 我该怎么办?插入For? 能帮帮我吗。 我将非常感激。 =)Hello, i am doing a project and i need some help.i created a button, "clean"in this button i put this validation, bellow.. Private Sub cleanbt_Click(sender As System.Object, e As System.EventArgs) Handles cleanbt.Click > If rbbut_company.Checked Then >> rbbut_company.Checked = False > ElseIf rdbut_compind.Checked Then >> rdbut_compind.Checked = False > ElseIf rbbut_indi.Checked Then >> rbbut_indi.Checked = False > End IfMy problem is, when I select a radio button, "company" or "any other",by clicking the button "clear" he cleans all, and lives any checked radio button..Here is an example to understand my problem:When I start the program the first thing is chosen is the name :name.radiobutton *nickname.radiobuttontelefon.radiobuttonemail.radiobuttonI choose another term to be different:name.radiobuttonnickname.radiobuttontelefon.radiobutton *email.radiobuttonwhen I click clean, he should go back and select like the first time, when i started the program , the name.like this:name.radiobutton *nickname.radiobuttontelefon.radiobuttonemail.radiobuttonbut the problem is: he cleans everything,but i a don''t want that. =/like this:nome.radiobuttonapelido.radiobuttontelefone.radiobuttonemail.radiobuttonnothing selectedi want to go back and select, like the first time, when i started the program , the "name".what should I do? insert a "For"?Could you help me please.I would be very grateful. =)推荐答案因为这些是单选按钮,所以任何时候都只能检查一个rb。单击其中一个将自动清除其余部分。如果你在代码中这样做会发生同样的情况。 在你的代码中你设置的值是 False 所以自动行为不起作用。尝试使用Because these are radio buttons only one rb may be checked at any time. Clicking on one of them will automatically clear the rest. The same will happen if you do it in code.In your code you are setting values to False so the automatic behaviour does not kick in. Try just usingPrivate Sub cleanbt_Click(sender As System.Object, e As System.EventArgs) Handles cleanbt.Click rbbut_company.Checked = TrueEnd Subname.radiobutton.Checked = True 这篇关于如何清除单选按钮而不删除“点”按钮形式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-22 23:03