金曜日, 4月 13, 2007
[VB.NET]CheckedListBox
Public Sub setCheckedListBoxSelected(ByRef oCListBox As CheckedListBox)
Dim value As Boolean = oCListBox.GetItemChecked(oCListBox.SelectedIndex) 'oCListBox.SetItemChecked(oCListBox.SelectedIndex, CBool(IIf(value.Equals(True), False, True))) oCListBox.SetItemCheckState(oCListBox.SelectedIndex, CType(IIf(value.Equals(True), CheckState.Unchecked, CheckState.Checked), System.Windows.Forms.CheckState)) If (oCListBox.SelectedIndex >= 0) Then oCListBox.SetSelected(oCListBox.SelectedIndex, False) oCListBox.Show()
End Sub
Dim value As Boolean = oCListBox.GetItemChecked(oCListBox.SelectedIndex) 'oCListBox.SetItemChecked(oCListBox.SelectedIndex, CBool(IIf(value.Equals(True), False, True))) oCListBox.SetItemCheckState(oCListBox.SelectedIndex, CType(IIf(value.Equals(True), CheckState.Unchecked, CheckState.Checked), System.Windows.Forms.CheckState)) If (oCListBox.SelectedIndex >= 0) Then oCListBox.SetSelected(oCListBox.SelectedIndex, False) oCListBox.Show()
End Sub