Not having Same Signature???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JohnT

    #1

    Not having Same Signature???

    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 SelectedIndexCh anged 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_I temCheck(ByVal sender As System.Object, ByVal e
    As System.EventArg s) Handles lvProjDisplay.I temCheck
    ListBox1.Items. Add(lvProjDispl ay.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
  • Mattias Sjögren

    #2
    Re: Not having Same Signature???

    [color=blue]
    > Private Sub lvProjDisplay_I temCheck(ByVal sender As System.Object, ByVal e
    >As System.EventArg s) Handles lvProjDisplay.I temCheck[/color]

    The method signature should be

    Private Sub lvProjDisplay_I temCheck(ByVal sender As System.Object,
    ByVal e As ItemCheckEventA rgs) Handles lvProjDisplay.I temCheck



    Mattias

    --
    Mattias Sjögren [MVP] mattias @ mvps.org
    http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
    Please reply only to the newsgroup.

    Comment

    Working...