ListView Happiness

S

samoore33

I am working with a program that utilized the checkbox property of a
listview. When a user clicked on the checkbox, it was suppose to
calculate and total some prices. I did not make any changes to the
listview, but now the method does not work when the checkbox is
clicked.

In trying to fix this problem, it would seem that when I click on the
checkbox it calls the itemcheck event. In the itemcheck event I check
to see if the state of the checkbox is True or False. I believe that it
only reads the checkbox as being checked, not as being populated with a
checkmark.

When I step through the method, after clicking a checkbox, it still
shows it false. If I click it again and step through the method it
shows it as true. Also if there is more then one item in the listview,
If one of the items is clicked, it shows the state of the checkbox as
false. If both of the items are clicked then it shows the state of the
checkbox as true.

If anyone has run into the problem before, I would appreciate any help.


If have not been clear enough with my problem, please let me know.

Appreciate any help.

Scott Moore
 
M

maligui

This happens when you use the checkbox, I would use the click event.

Private Sub CheckBox1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles CheckBox1.Click
Select Case Me.CheckBox1.Checked
Case True
'Do something
Case False
'Do something else
End Select
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top