Results 1 to 13 of 13

Thread: Here's a fun one...ToolTips, ListBoxes, DataSets..Oh MY! [RESOLVED,THIS BOARD ROCKS!]

Threaded View

  1. #7
    New Member
    Join Date
    Mar 2005
    Posts
    7

    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:
    1. Private Sub lbxRecPart_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lbxRecPart.MouseMove
    2. Try
    3.         ToolTip1.SetToolTip(lbxRecPart, dssrch.Tables("partdefinition").Rows(lbxRecPart.IndexFromPoint(lbxRecPart.PointToClient(lbxRecPart.MousePosition))).Item("PartDescription"))
    4.  
    5. Catch ex as Exception
    6. 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
  •  



Click Here to Expand Forum to Full Width