ListView and CheckBoxes

  • Thread starter Thread starter JohnT
  • Start date Start date
J

JohnT

I've an app with a ListView. It shows my info and a user can move back and
forth to display different week days info.

I've introduced checkboxes when a certain condition is meet.

What I've not been able to figure out is how to trap when line items are
'checked' off by a User.

In other words, when a user clicks on 5 line checkboxes (5 checks), how can I
display that on my form (ie in a Label).

I know how to get the 'count' and all... but not how to have the label updated
as items are checked and unchecked.

Mucho appreciated.

John
 
* JohnT said:
I've an app with a ListView. It shows my info and a user can move back and
forth to display different week days info.

I've introduced checkboxes when a certain condition is meet.

What I've not been able to figure out is how to trap when line items are
'checked' off by a User.

In other words, when a user clicks on 5 line checkboxes (5 checks), how can I
display that on my form (ie in a Label).

I know how to get the 'count' and all... but not how to have the label updated
as items are checked and unchecked.

Have a look at the control's 'ItemCheck' event.
 
With said:
Have a look at the control's 'ItemCheck' event.

Right... I tried that once (something like:

Private Sub lvProjDisplay_ItemCheck(ByVal sender As System.Object, ByVal e
As System.EventHandler) Handles lvProjDisplay.ItemCheck
If lblCopyItems.Visible = True Then
lblCopyItems.Text = "Items Left: " & lvProjDisplay.CheckedItems.Count()
Else
lblCopyItems.Text = "Items Left: 0"
End If
End Sub


And this gives an error... but the above is something that I'm working on.
What I want to have happen is for my label (lblCopyItems) to update each time
a user clicks (or unclicks) a checkbox on the listview form.

Thx
 
Back
Top