mardi 8 août 2017

Listview disable certain check box once checked

Please help me with this!
I have a ListView with checkboxes enabled. I need to disable all the checked items checkboxes, where the user should not try to click it again. Here is my code, where I am getting error.

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
    Try
        ' submit
        Dim path As String = "C:\Users\jtb43661\Documents\Visual Studio 2017\Projects\IGI Event Tracker\IGI Event Tracker\bin\Debug\Logs\Event.LOG"
        If Not File.Exists(path) Then
            Using sw As StreamWriter = File.CreateText(path)
            End Using
        End If
        Using sw As StreamWriter = File.AppendText(path)
            For Each item In ListView1.CheckedItems
                sw.WriteLine(item.Text & "->" & " Completed-@---> " & Label2.Text)
                item.SubItems.Add("Completed")
                item.BackColor = Color.GreenYellow
                'If item.subItems.text = "Completed" Then
                'here I need to disable or lock the checked checkboxes 

                'End If
            Next
            sw.Close()
        End Using
        MsgBox("Events Submitted Successfully")
    Catch ex As Exception
        MsgBox(ex.Message.ToString)
    Finally
    End Try
End Sub




Aucun commentaire:

Enregistrer un commentaire