Results 1 to 3 of 3

Thread: Checking a selected value on a checklistbox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    Outer space
    Posts
    97

    Checking a selected value on a checklistbox

    i need to know if an item is checked / unchecked but cannot find out how to do this in .net

    in vb6 the code was somthing like

    lstCheckList.Checked(i)

    this would return true or false but how do i do this in dot net ?

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: Checking a selected value on a checklistbox

    Originally posted by OptimusPrime
    i need to know if an item is checked / unchecked but cannot find out how to do this in .net

    in vb6 the code was somthing like

    lstCheckList.Checked(i)

    this would return true or false but how do i do this in dot net ?
    try this
    VB Code:
    1. Dim i As Integer = CheckedListBox1.SelectedIndex()
    2.         Dim bool As Boolean
    3.  
    4.         If i = 0 Then
    5.             MsgBox("0")
    6.             bool = True
    7.         ElseIf i = 1 Then
    8.             MsgBox("1")
    9.             bool = True
    10.         ElseIf i = 2 Then
    11.             MsgBox("2")
    12.             bool = True
    13.         Else
    14.             MsgBox("none checked")
    15.             bool = False
    16.         End If

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    Outer space
    Posts
    97
    many thanks but i decided to use a grid instead of the checked list box

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width