[Visual Basic] Private Sub Set_Checkedlistbox( _
ByRef clb As CheckedListBox, _
ByRef data As DataTable _
)
[Visual Basic] Private Sub Set_Checkedlistbox(ByRef clb As CheckedListBox, ByRef data As DataTable)
Dim i As Integer
For i = 0 To clb.Items.Count - 1
clb.SetItemCheckState(i, CheckState.Unchecked)
Next
Dim chk As Integer = 0
Dim ii As Integer
Dim oc As CheckedListBox.ObjectCollection = clb.Items
For i = 0 To data.Rows.Count - 1
For ii = 0 To oc.Count - 1
If oc.Item(ii).item(0) = data.Rows(i).Item(2) Then
clb.SetItemCheckState(ii, CheckState.Checked)
End If
Next
Next
End Sub
Plattformen: Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition