|
-
Jun 16th, 2005, 10:14 AM
#7
New Member
Re: Here's a fun one...ToolTips, ListBoxes, DataSets..Oh MY!
This should work for you. Andy was close with the MouseHover option. I would use Mouse move, as follows. I'm assuming the name ToolTip1 for the tool tip control,
VB Code:
Private Sub lbxRecPart_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lbxRecPart.MouseMove
Try
ToolTip1.SetToolTip(lbxRecPart, dssrch.Tables("partdefinition").Rows(lbxRecPart.IndexFromPoint(lbxRecPart.PointToClient(lbxRecPart.MousePosition))).Item("PartDescription"))
Catch ex as Exception
End Try
The empty Catch is neccessary because if you move your mouse over an empty area of the Listbox, the lbxRecPart.IndexFromPoint will return a -1, which is not a valid datatable row index and will throw an exception, which I wanted to ignore.
I believe this will work for you. I have does similar tooltips from a dataset except mine was in a tree view.
Last edited by KentDMc; Jun 16th, 2005 at 10:20 AM.
Reason: Corrected name of listbox
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|