Home All Groups Group Topic Archive Search About

Click and Double click events are not fired in listview component in VB.NET

Author
14 Jun 2006 12:02 PM
sethuganesh
hi,

     i have created a sample window aplication in VB.NET.placed a
listview component in the form ,written click and double click event
for list view.But the events are not fired.is there any property to be
set for click event.


Thanks,
Ganesh

Author
14 Jun 2006 12:18 PM
CT
How did you create the event handling code? Did you create it manually and
if so, did you use the WithEvents statement when declaring the listview and
add the Handles clause to the event handler procedure declarations, or are
you hooking up the event handlers with the AddHandler statement? I guess
what I am asking, is it possible that the event haven't been hooked up to
your event handlers?

--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk
---------
Voodoo Programming: Things programmers do that they know shouldn't work but
they try anyway, and which sometimes actually work, such as recompiling
everything. (Karl Lehenbauer)
---------
<sethugan***@gmail.com> wrote in message
Show quoteHide quote
news:1150286530.711493.134950@i40g2000cwc.googlegroups.com...
> hi,
>
>     i have created a sample window aplication in VB.NET.placed a
> listview component in the form ,written click and double click event
> for list view.But the events are not fired.is there any property to be
> set for click event.
>
>
> Thanks,
> Ganesh
>
Author
14 Jun 2006 12:24 PM
sethuganesh
hi,

listview is not created manually. Dragged it from the toolbox and
dropped it in the form.
This is the click event code

Private Sub ListView1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles ListView1.Click
        MsgBox("inside click")
    End Sub

Thanks,
Ganesh
Author
14 Jun 2006 12:48 PM
CT
Hmm, is the listview empty, and if not, are you clicking on an item or on
the "empty" part of the listview? If the listview is empty, try adding one
or more items using the Items property in the Properties window.

Are you trying to catch a click on an item?

--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk
---------
Voodoo Programming: Things programmers do that they know shouldn't work but
they try anyway, and which sometimes actually work, such as recompiling
everything. (Karl Lehenbauer)
---------
<sethugan***@gmail.com> wrote in message
Show quoteHide quote
news:1150287889.480655.251320@i40g2000cwc.googlegroups.com...
> hi,
>
> listview is not created manually. Dragged it from the toolbox and
> dropped it in the form.
> This is the click event code
>
> Private Sub ListView1_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles ListView1.Click
>        MsgBox("inside click")
>    End Sub
>
> Thanks,
> Ganesh
>
Author
14 Jun 2006 1:34 PM
sethuganesh
hi,

i have added some items and when i clicked on top of the item the event
ListView1_SelectedIndexChanged gets fired.whereas the click event is
not fired.

Thanks,
Ganesh
Author
14 Jun 2006 2:22 PM
CT
Hmm, I'm no ListView expert, but I believe the ItemSelectionChanged fires
when you click an item. It seems to be generally more useful than
SelectedIndexChanged, because the event handler is passed an instnace of the
ListViewItemSelectionChangedEventArgs class, which you can use to directly
reference the Item that was clicked. I don't know is that is what you're
after?

--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk
---------
Voodoo Programming: Things programmers do that they know shouldn't work but
they try anyway, and which sometimes actually work, such as recompiling
everything. (Karl Lehenbauer)
---------
<sethugan***@gmail.com> wrote in message
Show quoteHide quote
news:1150292059.781340.316620@y41g2000cwy.googlegroups.com...
> hi,
>
> i have added some items and when i clicked on top of the item the event
> ListView1_SelectedIndexChanged gets fired.whereas the click event is
> not fired.
>
> Thanks,
> Ganesh
>