Connecting Tech Pros Worldwide Forums | Help | Site Map

Hover over items in ListBox

Phil Kelly
Guest
 
Posts: n/a
#1: Nov 20 '05
Hi

I have a list box that I would like users to be able to hover over each item
in the collection to receive an explanation (like a context-sensitive help I
suppose) of the item.

How can this be achieved? I can not find how to do it anywhere!

Phil



One Handed Man \( OHM - Terry Burns \)
Guest
 
Posts: n/a
#2: Nov 20 '05

re: Hover over items in ListBox


The mouse hover event will fire once when you hover over the control, from
this event you can use the current mouse position to get the item and then
from this you can choose how to display text associate with it. This
following code will write the index to the output window, you just need to
decide how to display the data.

Private Sub ListBox1_MouseHover(ByVal sender As Object, ByVal e As
System.EventArgs) Handles ListBox1.MouseHover

Dim cc, sc As Point
cc = New Point
sc = New Point


sc = ListBox1.MousePosition()
cc = ListBox1.PointToClient(sc)

Debug.WriteLine(ListBox1.IndexFromPoint(cc))

End Sub

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Phil Kelly" <phil.kelly@infatech.com> wrote in message
news:ce006q$pa5$1@titan.btinternet.com...[color=blue]
> Hi
>
> I have a list box that I would like users to be able to hover over each[/color]
item[color=blue]
> in the collection to receive an explanation (like a context-sensitive help[/color]
I[color=blue]
> suppose) of the item.
>
> How can this be achieved? I can not find how to do it anywhere!
>
> Phil
>
>[/color]


Closed Thread