Имеется UserControl
при проверке у ComboBox какой у него SelectedIndex
(упрощенный вариант функции)
- Код: Выделить всё
Function N_col(ByVal k As Integer)
Dim sssl As String = ""
For Each combo In Me.Controls
If combo.GetType.FullName = "System.Windows.Forms.ComboBox" Then
sssl &= " k= " & k & ": combo.tag = " & combo.tag & ": combo.Name = " & combo.Name & _
": combo.SelectedIndex " & combo.SelectedIndex & vbCrLf
End If
Next
End Function
У меня на ХР работает отлично
k= 52: combo.tag = 11: combo.Name = ComboBox1: combo.SelectedIndex 1
k= 52: combo.tag = 12: combo.Name = ComboBox2: combo.SelectedIndex 2
k= 52: combo.tag = 22: combo.Name = ComboBox3: combo.SelectedIndex 3
k= 52: combo.tag = 21: combo.Name = ComboBox4: combo.SelectedIndex 2
k= 52: combo.tag = 32: combo.Name = ComboBox5: combo.SelectedIndex 4
k= 52: combo.tag = 31: combo.Name = ComboBox6: combo.SelectedIndex 3
k= 52: combo.tag = 42: combo.Name = ComboBox7: combo.SelectedIndex 5
k= 52: combo.tag = 41: combo.Name = ComboBox8: combo.SelectedIndex 4
k= 52: combo.tag = 52: combo.Name = ComboBox9: combo.SelectedIndex 6
У клиента
на W7 выдача индекса только по первой паре
k= 52: combo.tag = 11: combo.Name = ComboBox1: combo.SelectedIndex 1
k= 52: combo.tag = 12: combo.Name = ComboBox2: combo.SelectedIndex 2
k= 52: combo.tag = 22: combo.Name = ComboBox3: combo.SelectedIndex -1
k= 52: combo.tag = 21: combo.Name = ComboBox4: combo.SelectedIndex -1
k= 52: combo.tag = 32: combo.Name = ComboBox5: combo.SelectedIndex -1
k= 52: combo.tag = 31: combo.Name = ComboBox6: combo.SelectedIndex -1
k= 52: combo.tag = 42: combo.Name = ComboBox7: combo.SelectedIndex -1
k= 52: combo.tag = 41: combo.Name = ComboBox8: combo.SelectedIndex -1
k= 52: combo.tag = 52: combo.Name = ComboBox9: combo.SelectedIndex -1
В чем может быть причина такого поведения?