Click here to Skip to main content
15,887,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want these Items to become visible after I save it. Because every time I click the "save" button. It also disappears. I want to make the checked item as visible as possible. Here's my code.

VB
CheckBox1.Checked = False
        listview.Enabled = True
        Dim tmp

        Dim check As String
        Dim i
        Dim X

        For X = 0 To listview.Items.Count - 1
            listview.Items(X).Checked = False
        Next

        tmp = combobox.Text.Split("/")

        check = "select accessid,forms as checkform from userform_tab where accessid='" & (tmp(0)) & "'"
        CLSCONN = New C_connection
        CLSCONN.ACCESS_INDREC(check)
        With CLSCONN.ds
        End With
        For i = 1 To listview.Items.Count
            If String.Compare("your Comapre String1", "your Comapre String2") = 0 Then
                listview.Items(i).Checked = True
            End If
        Next
Posted
Updated 14-Oct-13 0:39am
v6

1 solution

Try comparing like given below -

VB
For i = 1 To ListView.Items.Count
    If String.Compare(Convert.ToString("your Comapre String1").ToLower(), Convert.ToString("your Comapre String2").ToLower()) = 0 Then
        ListView.Items(i).Checked = True
    End If
Next
 
Share this answer
 
v2
Comments
Gadgetzoned 14-Oct-13 10:22am    
It doesn't work
I tried to comment it also
If String.Compare("your Comapre String1", "your Comapre String2") = 0 Then
but all items are checked

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900