By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,572 Members | 1,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,572 IT Pros & Developers. It's quick & easy.

Hover over items in ListBox

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <ph********@infatech.com> wrote in message
news:ce**********@titan.btinternet.com...
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

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.