Setthing Tooltip for Combobox Items-VBForums
Results 1 to 12 of 12

Thread: Setthing Tooltip for Combobox Items

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    73

    Setthing Tooltip for Combobox Items

    How do I set tooltip value for each combo box items such that the tooltip displays when I scroll down the list and highlight any item. I can make it to show the tooltip only for the selected item after I click but now when I mouse over or highlight. Any ideas.

    Thank you,

  2. #2
    Moderator.NET kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,246
    i don't believe that items in a combobox have tooltiptext properties... since the items themselves are not objects... the control itself is an object.. the items in the drop down are just text..
    Using VS.NET 2013/.NET 2.0 through 4.5 * Please mark you thread resolved using the Thread Tools above
    PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!!
    * If you found a post useful then please Rate it! * DO NOT PM ME WITH LINKS TO YOUR THREADS FOR ANSWERS PLEASE!

    Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup
    ZerosAndTheOne.com
    -=Matt=-

  3. #3
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335
    No.

    Combo box controls do not have any type of Mouse event. There is no MouseMove, MouseUp, MouseDown, etc. If you switched to a Listbox, they do have Mouse controls, but you still couldn't show individual tooltips for individual items unless you wrote individual tooltips back to a Db table, and read them everytime the mouse moved to a new it.

    This is, however, impractical. Thats way too many Db reads, and if you Db is on a network server, the traffic would go monsterous.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    73
    Exactly Kleinma. For the combo box itself, it works after the item is selected. However, is there any api or other ways how you could get the combo items to behave similarly. I am using an api call for the listbox using mouse_move event, but no such event is available in Combo Box. My items text in combo box may be long and I do not want the combo box to be as long as the text, therefore, I thought tooltiptext might be helpful, if there is a way to do it not sacrificing what Hack has posted.

    Thank you,

  5. #5
    Moderator.NET kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,246
    ummm well i guess instead of doing database reads you could load the tooltips into variables or an array or something like that when you load the actual box.. but that doesn't change the fact that there are no event (like hack said) to determine when the mouse is over a specific item... maybe the list box would be a better bet?

    attached is a little app i wrote for someone on here when i was bored.. maybe u could mess around with that... it makes a form simulate as a tooltip.. because the person i actually made it for wanted a tooltip that would change its message while over the same item.. which the tool tip doesn do... anyway.. maybe you could mess around with it and get it to help a little.. even if you dont get exactly what you are after..
    Attached Files Attached Files
    Using VS.NET 2013/.NET 2.0 through 4.5 * Please mark you thread resolved using the Thread Tools above
    PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!!
    * If you found a post useful then please Rate it! * DO NOT PM ME WITH LINKS TO YOUR THREADS FOR ANSWERS PLEASE!

    Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup
    ZerosAndTheOne.com
    -=Matt=-

  6. #6
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335
    Would it be practical for you to extend the length of the combo box, at run time, to the length of the longest item, whatever that item may be, now or in the future?
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    73
    No, extending combo box to the max length of the item would not be practical in my case. I cannot use listbox because listbox does not have a drop down feature. List box shows all the items in one view.

    But, I am going to look at what Kleinma has done.

    Thanks

  8. #8
    Fanatic Member
    Join Date
    Jun 2003
    Location
    IL
    Posts
    739
    h20168-

    I know this was posted a very long time ago, but worth a shot. Did you ever figure out a way of doing this? I have the same exact problem. If you did not find a solution could you please let me know anyway so that I am not here waiting .

    Thanks!
    Maldrid
    Motto: Anything for a laugh.

    Getting second place only means you are the first loser to cross the finish line.

  9. #9
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    Hack f*****g hell, how come you have such a huge post count!

  10. #10
    Moderator.NET kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,246
    you wont get an answer from him since he has since left the forums over a year ago...
    Using VS.NET 2013/.NET 2.0 through 4.5 * Please mark you thread resolved using the Thread Tools above
    PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!!
    * If you found a post useful then please Rate it! * DO NOT PM ME WITH LINKS TO YOUR THREADS FOR ANSWERS PLEASE!

    Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup
    ZerosAndTheOne.com
    -=Matt=-

  11. #11
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253
    Ooops, didnt realise this post was a year old

    Geeeez, he must of been a heavy poster

  12. #12

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.