单选按钮事件 [英] Event of RadioButtons
本文介绍了单选按钮事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的问题.
我有几个单选按钮.如果我点击表单上的第一个 Radiobutton 创建 TextBox,如果点击第二个 - 创建第二个 TextBox,如果我再次点击第一个 RadioButton,又是一个TextBox,有可能吗?
I have a few RadioButtons. If i click on first Radiobutton on form create TextBox, if click on second - create second TextBox and if i click again on first RadioButton, again one TextBox,is it possible?
请给我出主意.
并且没有属性可见.
推荐答案
尝试这样的事情(这只是其中之一):
Try something like this (this is only one of them):
TextBox t;
private void radio_CheckedChanged(object sender, System.EventArgs e)
{
if (radio.Checked) {
t = new TextBox();
t.Top = radio.Top;
t.Left = radio.Left + radio.Width;
this.Controls.Add(t);
t.Show();
} else {
if (t!=null)t.Dispose();
}
}
这篇关于单选按钮事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文