组合框中的问题选择值? [英] problem in combo box select value?

查看:51
本文介绍了组合框中的问题选择值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.....

我在我的项目中使用了多个组合框

我的问题是当我在一个组合框中选择一个值而不是所有组合框值自动选择相同。但是我在所有组合框中选择了不同的值。

如何在我的所有组合框中选择不同的值?

如何解决它? br />
我在所有组合中使用相同的数据源

请回复......

Hi.....
I use more than one combo box in my project
my problem is when i select one value in one combo box than all combo box value is automatically selected same.but i select diffrent value in all combo box.
how to select diffrent value in my all combo box ?
how to solve it?
I use same data source in all combo
Please reply......

推荐答案

要求听起来有点奇怪,因为如果所有组合框都按照一个组合框的选择,其他组合框的目的是什么....



无论如何你没有提到你使用的UI技术,但如果这是例如Forms,你可以连接 SelectedIndexChanged [ ^ ]事件,在该事件处理程序中,您将设置 SelectedIndex [ ^ ]其他组合框的属性。



例如

The requirement sounds a bit odd since if all of the combo boxes follow the selection of one combo box, what is the purpose of the other combo boxes....

Anyhow you didn't mention what UI technology you use but if this is for example Forms, you would wire SelectedIndexChanged[^] event and in that event handler you would set the SelectedIndex[^] property for the other combo boxes.

For example
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) {
   this.comboBox2.SelectedIndex = this.comboBox1.SelectedIndex;
}



基本思路也与其他UI技术相同。


The basic idea is the same also with other UI technologies.


这篇关于组合框中的问题选择值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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