473,320 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Mouse over tooltip

I have a ListBox, which is binded to a DataTable.
I would like to display a tooltip when the mouse cursor hovers over the
items in the ListBox.
I don't know how to find the index if ListBox item, on which mouse
cursor is over and how to display the tooltip.
Any suggestions?

TIA

Nov 21 '05 #1
5 11978
In the ListBox's "MouseMove" event, you can track the mouse location and set
form level variables to it's X,Y location. Then in the MouseHover Event, you
can get the ListBox Index that the mouse is over from the IndexFromPoint
method and the X,Y form level variables. You can then assign ToolTip.Text
equal to whatever you want depending on the index that the mouse is hovering
over. Unfortunately, I haven't found a way to get the tooltip to redisplay
unless the mouse is moved out of the control then back over the control.

--
Dennis in Houston
"Nikolay Petrov" wrote:
I have a ListBox, which is binded to a DataTable.
I would like to display a tooltip when the mouse cursor hovers over the
items in the ListBox.
I don't know how to find the index if ListBox item, on which mouse
cursor is over and how to display the tooltip.
Any suggestions?

TIA

Nov 21 '05 #2
In the ListBox's "MouseMove" event, you can track the mouse location and set
form level variables to it's X,Y location. Then in the MouseHover Event, you
can get the ListBox Index that the mouse is over from the IndexFromPoint
method and the X,Y form level variables. You can then assign ToolTip.Text
equal to whatever you want depending on the index that the mouse is hovering
over. Unfortunately, I haven't found a way to get the tooltip to redisplay
unless the mouse is moved out of the control then back over the control.

--
Dennis in Houston
"Nikolay Petrov" wrote:
I have a ListBox, which is binded to a DataTable.
I would like to display a tooltip when the mouse cursor hovers over the
items in the ListBox.
I don't know how to find the index if ListBox item, on which mouse
cursor is over and how to display the tooltip.
Any suggestions?

TIA

Nov 21 '05 #3
Hi,

When I use this code the tooltip is always displayed when the mouse
is over the listbox.

Private Sub ListBox2_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles ListBox2.MouseMove
Dim i As Integer = ListBox2.IndexFromPoint(e.X, e.Y)

If i >= 0 Then ToolTip1.SetToolTip(ListBox2,
ListBox2.Items.Item(i).ToString)

End Sub

Ken
---------------------------
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
In the ListBox's "MouseMove" event, you can track the mouse location and
set
form level variables to it's X,Y location. Then in the MouseHover Event,
you
can get the ListBox Index that the mouse is over from the IndexFromPoint
method and the X,Y form level variables. You can then assign ToolTip.Text
equal to whatever you want depending on the index that the mouse is
hovering
over. Unfortunately, I haven't found a way to get the tooltip to
redisplay
unless the mouse is moved out of the control then back over the control.

--
Dennis in Houston
"Nikolay Petrov" wrote:
I have a ListBox, which is binded to a DataTable.
I would like to display a tooltip when the mouse cursor hovers over the
items in the ListBox.
I don't know how to find the index if ListBox item, on which mouse
cursor is over and how to display the tooltip.
Any suggestions?

TIA

Nov 21 '05 #4
Hi,

When I use this code the tooltip is always displayed when the mouse
is over the listbox.

Private Sub ListBox2_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles ListBox2.MouseMove
Dim i As Integer = ListBox2.IndexFromPoint(e.X, e.Y)

If i >= 0 Then ToolTip1.SetToolTip(ListBox2,
ListBox2.Items.Item(i).ToString)

End Sub

Ken
---------------------------
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
In the ListBox's "MouseMove" event, you can track the mouse location and
set
form level variables to it's X,Y location. Then in the MouseHover Event,
you
can get the ListBox Index that the mouse is over from the IndexFromPoint
method and the X,Y form level variables. You can then assign ToolTip.Text
equal to whatever you want depending on the index that the mouse is
hovering
over. Unfortunately, I haven't found a way to get the tooltip to
redisplay
unless the mouse is moved out of the control then back over the control.

--
Dennis in Houston
"Nikolay Petrov" wrote:
I have a ListBox, which is binded to a DataTable.
I would like to display a tooltip when the mouse cursor hovers over the
items in the ListBox.
I don't know how to find the index if ListBox item, on which mouse
cursor is over and how to display the tooltip.
Any suggestions?

TIA

Nov 21 '05 #5
Thanks Ken

Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nikolay Petrov | last post by:
I have a ListBox, which is binded to a DataTable. I would like to display a tooltip when the mouse cursor hovers over the items in the ListBox. I don't know how to find the index if ListBox item,...
5
by: Nick | last post by:
Hey guys, I have 2 events on a windows forms datagrid, the mouse move as well as the double click events. What's happening is that when I double click on a row in the grid, the mouse move event...
5
by: Pavan | last post by:
My goal is to accomplish the tooltip functionality for all the neodes in a tree view and i have the following three Events in my C# application. Name of my TreeView Control (AITreeView) 1)...
2
by: cody | last post by:
What are the yellowish popups that appear when you mouse over certain objects. An example are the descriptions that appear in VS2005 when hover your mouse over controls in the toolbox. I'd like...
3
by: Eric Layman | last post by:
Hi everyone. An image allows alt attribute. When mouse over images with alt attribute, a small yellow popup would appear besides the mouse cursor. How to replicate this behaviour using a table...
2
by: hini | last post by:
Hi all, I use IE, and I am trying to display a tooltip using javascript. the problem is that the tooltip is not apearing where I want it to be. I am getting the mouse location using clientX and...
7
exoskeleton
by: exoskeleton | last post by:
hi guys..hope you can help me...my boss want me to edit our website and apply the tooltip thing, i mean the moving tooltip that follows the mouse.. please help...thank you... :(
7
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello, I'm using the ToolTip control, but I want it to behave a bit different. I want the toolTip to popup not only once when the control is enter and the mouse is stationary. I want the...
0
by: tezu | last post by:
Hi all, Im currently having a list view with two columns Key and Value .Key column contains Items and the VAlue contains the subitems.... I want to dispaly the value of each item n subitem in a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.