Not having Same Signature???

J

JohnT

I'm using VB.net (2000 standard)

I've a ListBox with Checkboxes... I'm trying to figure out how to get the the
number of items checked as a User checks and un-checks them.

I can do this IF I have the User 'click' on the ListView (after checking
items) and use the LB SelectedIndexChanged event (to display the ItemCheck
event). But I want to get the ItemCheck 'while' a user it clicking the
checkboxes and NOT to have to click the ListView afterwards.

I'm stuck right now... when I try something like:

Private Sub lvProjDisplay_ItemCheck(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles lvProjDisplay.ItemCheck
ListBox1.Items.Add(lvProjDisplay.CheckedItems.Count)
End Sub

.... I get an error message on the end item of the Private Sub:

Method 'lvProjDisplay_ItemCheck' cannot handle Event 'ItemCheck' because they
do not have the same signature

I've tried a few other events... but the same situation...

Anyone know what the heck is going on?

Thanks!

JohnT
 
M

Mattias Sjögren

Private Sub lvProjDisplay_ItemCheck(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles lvProjDisplay.ItemCheck

The method signature should be

Private Sub lvProjDisplay_ItemCheck(ByVal sender As System.Object,
ByVal e As ItemCheckEventArgs) Handles lvProjDisplay.ItemCheck



Mattias
 

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