老师,我在论坛中看了类似的提问有几个,我引用了其中的代码,但对代码理解不是很明白,问题如下:
在窗口的工号组合框下拉时,已显示了 001/老李,但点击选择后,填入组合框的是 001/老李,而不是001,
SelectedIndexChanged引用代码
Dim arys As List(Of String()) = DataTables("员工档案").GetValues("员工工号|员工姓名","员工工号 is not null")
Dim str As String = ""
Dim s1, s2 As Integer
For Each s As String() In arys
If s(0).Length > s1 Then
s1 = s(0).Length
End If
If s(1).Length > s2 Then
s2 = s(1).Length
End If
Next
For Each s As String() In arys
str &= s(0).PadLeft(s1) & "/" & s(1).PadLeft(s2) & "|"
Next
e.Form.Controls("ComboBox1").ComboList = str.Trim("|")