在vb.net中的帮助,组合框的选定项目反映到组合框选定的项目 [英] Help in vb.net , selected item of a combo box reflects to othe comboboxes selected item

查看:113
本文介绍了在vb.net中的帮助,组合框的选定项目反映到组合框选定的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有这个代码

  Dim  list 作为 列表(  ComboBox)( ComboBox(){ComboBox1,ComboBox2,ComboBox3,ComboBox4,ComboBox5,ComboBox6,ComboBox7,ComboBox8,ComboBox9,ComboBox10,ComboBox11,ComboBox12,ComboBox13,ComboBox14,ComboBox15})
对于 每个作为 ComboBox 列表
使用
.DataSource = DS.Tables( one1
.DisplayMember = sub_c1
结束 使用
下一页





在我的代码中我用数据集表中的15个combebox填充相同的字段。我没有填写问题的
问题。问题是,当我运行我的程序然后我看到所有15个组合框正确填充

但是当选择任何这些组合框的项目时,所选项目出现在所有其他组合框中,....我尝试了其他代码来填充它们但问题没有在表格中解决....需要帮助解决这个问题:)谢谢

解决方案

尝试这个,我没有' t测试

。DataSource = DS.Tables(  one1\" )。AsEnumerable()。CopyToDataTable()


Hi all, i have this code

Dim list As New List(Of ComboBox)(New ComboBox() {ComboBox1, ComboBox2, ComboBox3, ComboBox4, ComboBox5, ComboBox6, ComboBox7, ComboBox8, ComboBox9, ComboBox10, ComboBox11, ComboBox12, ComboBox13, ComboBox14, ComboBox15})
            For Each item As ComboBox In List
                With item
                    .DataSource = DS.Tables("one1")
                    .DisplayMember = "sub_c1"
                End With
            Next



in my code i fill 15 combebox with the same feild from a table of dataset .i donot have
problem in filling . the problem is that when i run my program then i see all 15 comboboxes filled
correctly but when select an item of any of these comboboxes then the selected item appears in all the others comboBoxes ,....i tried others codes to fill them but the problem not solved in the form .... need help for this problem :) thanks

解决方案

try this, I haven't tested

.DataSource = DS.Tables("one1").AsEnumerable().CopyToDataTable()


这篇关于在vb.net中的帮助,组合框的选定项目反映到组合框选定的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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