我有一个代码,但它只填充checkedlistbox中的项目..
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(带有{.Text = y&“[”&items&“]”的新ListItem,.Value = y,.Enabled = False})