从组合框中选择值 [英] choose value from combobox
本文介绍了从组合框中选择值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在其中有一个组合框,当我从其中选择一个特定值时,我想要一个值.另一个文本框是否可见,取决于我将从组合框中选择的值.
I have a combobox inside it some value I want when I select a specific value from it another text box it''s visible become true depends on the value which I will choose from the combobox
推荐答案
类似的东西?
Something like this??
itemsComboBox.Items.Add("Dog");
itemsComboBox.Items.Add("Cat");
itemsComboBox.Items.Add("Pig");
private void itemsComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
switch ((string)itemsComboBox.SelectedItem)
{
case "Dog":
testTextBox.Visible = true;
break;
case "Cat":
break;
case "Pig":
break;
}
}
这有帮助吗?
Does that help?
这篇关于从组合框中选择值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文