【发布时间】:2018-01-16 04:31:34
【问题描述】:
请帮帮我!
我有一个启用了复选框的ListView。我需要禁用所有选中的项目复选框,用户不应尝试再次单击它。
这是我的代码,我遇到了错误。
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
【问题讨论】: