Hello everyone,
I am making an application that has employees in a listview.
When the client clicks on one of the employees end clicks the remove button I wan to ask the client if they want to remove the employee.
The problem is when I click NO it still removes the Item from the listview.
My code:
lvEmployees is my listview name.
VB.netThanks for the help.Code:For I = 0 To lvEmployees.SelectedItems.Count - 1 If Not I = -1 Then MsgBox("Do you really want to remove " & lvEmployees.Items.Item(I).Text & " " & lvEmployees.Items.Item(I).SubItems(1).Text & "?", MsgBoxStyle.YesNo) If MsgBoxResult.Yes Then lvEmployees.SelectedItems.Item(I).Remove() Else Exit Sub End If End If Next![]()
![]()




Reply With Quote
