我在这里有代码,但只填充了复选框中的项目。
Dim lst As New List(Of String) From {dtr.GetInt32("fps_pump_id")}
Do
For Each items As String In lst
y = dtr.GetInt32("fps_pump_id")
PumpStation.CheckedListBox1.Items.Add(y & " [" & items & "]")
PumpStation.CheckedListBox1.Items(y).Enabled = False 'this line won't work
Next
x += 1
Loop Until x = ps_table.Rows.Count
dtr.getIn32("fps_pump_id")
是预加载的MySqlDataReader
,我曾经从本地数据库中获取数据。
CheckedListBox1.Items.Add(New ListItem With {.Text = y & " [" & items & "]", .Value = y, .Enabled = False})