vb2010与vb6.0中的控件用法完全不同,请问高手,在vb2010中控件combobox的用法?请您费心了。
vb6.0中combobox1的用法:combobox1.Cleararrayindex=0Forj=1Tom0arrayindex=arrayindex+1combob...
vb6.0中combobox1的用法:
combobox1.Clear
arrayindex = 0
For j = 1 To m0
arrayindex = arrayindex + 1
combobox1.AddItem gg(j)
combobox1.ItemData(combobox1.NewIndex) = arrayindex
Next j
combobox1.Text = combobox1.List(i - 1)
在vb2010中如何实现?? 展开
combobox1.Clear
arrayindex = 0
For j = 1 To m0
arrayindex = arrayindex + 1
combobox1.AddItem gg(j)
combobox1.ItemData(combobox1.NewIndex) = arrayindex
Next j
combobox1.Text = combobox1.List(i - 1)
在vb2010中如何实现?? 展开
2个回答
展开全部
vb6.0的Combo1 与 vb2010的Combobox1用法有很大区别,就你补充的代码可以这样实现:
Me.ComboBox1.Items.Clear()
Dim arrayindex As Integer = 0
Dim m0 As Integer = 5 '姑且等于5吧
For j As Integer = 1 To m0
arrayindex = arrayindex + 1
Me.ComboBox1.Items.Add(gg(j)) 'gg() 要你事先求好
Microsoft.VisualBasic.Compatibility.VB6.SetItemData(ComboBox1, ComboBox1.Items.Count() - 1, arrayindex) '要引用Microsoft.VisualBasic.Compatibility
Next j
ComboBox1.Text = ComboBox1.Items(i - 1) ' i你要事先定义付值
Me.ComboBox1.Items.Clear()
Dim arrayindex As Integer = 0
Dim m0 As Integer = 5 '姑且等于5吧
For j As Integer = 1 To m0
arrayindex = arrayindex + 1
Me.ComboBox1.Items.Add(gg(j)) 'gg() 要你事先求好
Microsoft.VisualBasic.Compatibility.VB6.SetItemData(ComboBox1, ComboBox1.Items.Count() - 1, arrayindex) '要引用Microsoft.VisualBasic.Compatibility
Next j
ComboBox1.Text = ComboBox1.Items(i - 1) ' i你要事先定义付值
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询