Results 1 to 21 of 21

Thread: picturebox as tootltip

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    picturebox as tootltip

    I don't know whether I am asking right question ,, but I thought is this possible to make picture box as tooltip for Listbox .. each listbox item will have different picturebox tooltip ..

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: picturebox as tootltip

    There's no need for a PictureBox. See How do I show ToolTipText on each ListBox item?
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: picturebox as tootltip

    Thanks Sir, My question is about picturebox as tooltip not tooltip text .. what I mean by picturebox as container for an image and text to show as tooltip on listbox items

  4. #4
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: picturebox as tootltip

    It might help if you describe a few things -
    - How long it will be visible ? EG Should it be visible all the time the mouse is hovering over an entry in the Listbox, or does it disappear after a certain time.
    - What size will it be ?
    - Will it be the same size every time ? If not then give the min and max size
    - What rules do you want for where it will be positioned relative to the entry in the Listbox, and what do you desire when there ain't room in the default position

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: picturebox as tootltip

    sir about visibility .. same as normal tooltip .. it should be visible all the time the mouse is hovering over on list item

    any size doesn't matter but with image as well as text .. different for each list item

    rest everything like normal tooltip

  6. #6
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: picturebox as tootltip

    I assume that response time will be important (user does not want to wait too long to see the Tooltip).
    Can you pre-prepare each tooltip ?
    They could perhaps be created and stored into a control array of pictureboxes whilst the Form is loading, or whilst the listbox is being populated.
    The control array could be located off screen (Left property say -9999)
    Then when the user mouses over a listbox line, the program will know which picturbox to move to the desired tooltip position.

    Picureboxes can be 'printed' to with 98% of the print to paper commands. So anything that can be done with native VB6 print commands, can be used to place image and text into each picturebox.

    The above is not your complete solution (yet), but I feel needs addressing (answering) before you go much further.

    Rob

  7. #7
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: picturebox as tootltip

    If you want a tooltip like this:


    Then VB's tooltip capabilities won't be enough. You'll need to use a ToolTip UserControl or Class like the ones shown here or here in conjunction with the code linked to in post #2.
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: picturebox as tootltip

    Quote Originally Posted by Bobbles View Post
    They could perhaps be created and stored into a control array of pictureboxes whilst the Form is loading, or whilst the listbox is being populated.
    The control array could be located off screen (Left property say -9999)
    Then when the user mouses over a listbox line, the program will know which picturbox to move to the desired tooltip position.
    will you please provide me a such code to achieve this

  9. #9
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: picturebox as tootltip

    Quote Originally Posted by janu View Post
    will you please provide me a such code to achieve this
    I will have a bash.
    Download this in the meantime, and get familiar with it. Also use it to provide feedback with any extra details that you may not have supplied us.
    http://www.codeguru.com/vb/controls/...stBox-Item.htm
    The code looks very similar to Bonnie's

    I will use it as a starting point for my picturebox enhancements

    Rob

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: picturebox as tootltip

    Quote Originally Posted by Bobbles View Post
    I will have a bash.
    Download this in the meantime, and get familiar with it. Also use it to provide feedback with any extra details that you may not have supplied us.
    http://www.codeguru.com/vb/controls/...stBox-Item.htm
    The code looks very similar to Bonnie's

    I will use it as a starting point for my picturebox enhancements

    Rob

    brother ... this I already know about .. again I say my question is about custom tooltip .. picturebox as container for Image as well text [say label or textbox] to display as a tooltip on listbox items ...

    I also know about balloon type tooltip

    I mean this





  11. #11
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: picturebox as tootltip

    I was just sending the code that I am using as a starting point.
    I am now enhancing it to demonstrate some of the concept I described above.
    You should try harder to provide ALL the details, rather than they be revealed as we go a long.
    EG Will the number of entries in the list be known at design time, or is it dynamic ?

    Have you used VB6's print commands ?
    You could be studying up on that, so that you will be able to code the print instructions that will send text and image to the pictureboxes.

    Rob

  12. #12
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: picturebox as tootltip

    Tooltip_Pictureboxes_ver_01.zip

    The attached is just to demonstrate the use of a picturbox control array.
    With printing to the individual pictureboxes, during Form_Load
    The pictureboxes are moved out of sight (-9999)
    The pictureboxes are moved to the right when the matching Index in the Listbox is moused over.
    I have NOT fine tuned the postioning of the picturebox (tooltip). That can be done later.
    I have NOT demonstrated 'printing' an image in to the Picturebox. That can be done later.
    The number of pictureboxes was pre-loaded in the IDE. That can be done dynamically (by code) later if you describe such a need (If you do not know the number of listbox items at design time)

    Rob
    Last edited by Bobbles; Aug 13th, 2013 at 05:54 AM. Reason: Forum's Attachment dialog is NOT IDIOT PROOF

  13. #13
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: picturebox as tootltip

    OOPs
    I had slightly abbreviated the text, whilst debugging.
    Attached has longer text in the listbox and ToolTip
    Attached Files Attached Files

  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: picturebox as tootltip

    Thanks Bobbles , the is some how exactly the same as I want but there are few unrelated things like picTT is outside of listbox , it should have been the way as the normal TT is .. exactly near the mouse cursor as the mouse cursor moves the TT also moves ...

  15. #15
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: picturebox as tootltip

    The attached is now similar to what you want.
    It will need modification to meet your needs.

    I just checked back to one of your earlier threads, where I got extremely angry.
    I would have hoped that you would have learned from that thread, that -
    - Providing insufficient information
    - Ignoring questions asked by us
    - Feeding out little bits of information
    (- Possibly changing the information )
    can be extremely frustrating.

    I am not saying that you are guilty of ALL of that YET.
    You did not answer my question regarding knowledge of number of items.
    In the absence of your answer, I have included code to create the extra pictureboxes dynamically (out of thin air).
    Please take extra care to avoid casual/vague attention to details, as my tolerance will be one point above zero.

    Rob
    Attached Files Attached Files

  16. #16
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: picturebox as tootltip

    There is a minor bug with what is showing in the ToolTip.
    I will look into it.

    Rob

  17. #17

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: picturebox as tootltip

    Dear Bro. I never provided insufficient information when I need any sort of help .. I always appreciate help provided by masters here .. if some time by any means something happen like I did not answer any question asked by master related to my request only then I am extremely sorry for that.

    Ok, there is a bug in the sample provided by you .. tooltip pic is stuck on one place only [static]

  18. #18
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: picturebox as tootltip

    Read back over this thread, and you will see that I have asked more questions than you have answered.
    See my post 4
    EG I asked for your rules regarding positioning of the ToolTip

    If you are not recognizing that you are way too casual and vague with your posts, then I cannot risk what happened to me last time (I got unbelievably angry, and I was lucky not have a 71 year old heart attack).

    So I will politely exit this thread, and leave it to other younger/healthier members to finish assisting you.

    Regards,
    Rob

  19. #19
    gibra
    Guest

    Re: picturebox as tootltip


  20. #20
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: picturebox as tootltip

    I can't imagine anything better than the one from PSC.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  21. #21
    Member
    Join Date
    Mar 2014
    Posts
    57

    Re: picturebox as tootltip

    wrong topic srry

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