Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tool Tip on ListView (VB6)

    Is there a way to create a ToolTip that will display the listitem in a ListView control when hovering the cursor over the item?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Tool Tip on ListView (VB6)

    You should be able to use the event triggered by selecting an item to set the ListView's ToolTipText property to the appropriate string. I'm not sure what purpose it serves though unless you want to select something and then come back later to see what it was by hovering the mouse. <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tool Tip on ListView (VB6)

    Charlotte, I may not have described this very well. What I am trying to accomplish is a Microsoft type look that will display, say, a file name that is longer then the width of the column in a tool tip type pop-up. Now that I think about it, there was an article I read in the VB Programmer's Journal that said they would cover this at some point, making me think it is a lot more complicated than I think.

  4. #4
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tool Tip on ListView (VB6)

    Not having opened VB in a while,

    My guess is that to do something like this you will need to use the mousemove event of the listbox to find out where the mouse is in the listbo, and you will also need to findout WHERE in the list of data you are and then figure out if the data is longer/wider than the display area of the listbox.

    I have seen something like this before.

    You may want to have a look at the VB MVPs site. You can finds links at http://www.mvps.org
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Tool Tip on ListView (VB6)

    So are you trying to display a "tooltip" for each item the mouse hovers over or for a selected item?
    Charlotte

  6. #6
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tool Tip on ListView (VB6)

    Yes. Now that I think about it, and to make it even more complicated, it would also need to only do it for listitem values that are longer than the width of the column that is containing it. This is a little more time than it is worth, so please disregard the question. I'll bet there is even a 3rd party control out there that will have this option.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •