Winform中组合框和标签之间的关系 [英] relationship between combobox and label in winform

查看:65
本文介绍了Winform中组合框和标签之间的关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有30个标签和一个组合框,当用户单击标签组合框时我想要
显示标签文字,我的组合很有用.

请指导我.

Hi All,

I have 30 label and one combo box and I want when user click on label the combo box
show text of label and my combo has value.

Please guide me.

推荐答案

希望
Hope this[^] might help you.


使用此代码

Use this code

if (comboBox1.DropDownStyle == DropDownList)
{
comboBox1.Items.Add(Label1.Text);
comboBox1.Text = Label1.Text;
}
else
{
comboBox1.Text = Label1.Text;
}


这篇关于Winform中组合框和标签之间的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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