CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Guest

    Can we Create user shaped tooltips in VB

    Normally we have a rectangle shape to display a tooltip text in vb. Can we create our own shape like we have in Lotus Notes where u get ballon tooltips.
    Is it possible by some way to simulate this.

    Sandra


  2. #2
    Join Date
    Nov 1999
    Posts
    18

    Re: Can we Create user shaped tooltips in VB

    Yes you can. There are third party OCXs that do the job, or you can do it the hard way... making another form and shaping it to look like your tooltip using SetWindowRgn API. Normally it is hidden but it is displayed when the user moves the mouse over a certain control.

    psiclone


  3. #3
    Guest

    Re: Can we Create user shaped tooltips in VB

    Do u have any idea about what are the third party OCX's available which can solve my purpose.



  4. #4
    Join Date
    Nov 1999
    Posts
    18

    Re: Can we Create user shaped tooltips in VB

    Sorry, I'm afraid I use the second method more. I can suggest a VBX for VB3 though - DBTTip.vbx, I don't know if a newer version is available as an OCX for VB5/6.
    Search for "OCX","tooltip" and "shape" at the major search engines. You're bound to find something. Or if you know someone who is a VB expert or a good C programmer, you could get them to write one for you... It's not that hard, honest!

    psiclone


  5. #5
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Can we Create user shaped tooltips in VB

    Just an idea... i dont know how far this is feasible..

    If you can get the handle of the too-tip window ( which is after all a window), you can set its window region to non-rect region,and it should show in that shape, next time on!, unless somewhere inside he is correcting the shape back ( which i dont think so).

    So abt how to get the tool tip text window handle: one possible ( not so clear/n ) route: before the tool tip is shown, every parent window (ie the control for which it is going to show the tip) recieves a TTN_SHOW message, and this message will have a hWndfrom parameter which will be toop-tip window's handle. You can catch this, and try. and BEST OF LUCK :-) save your work every often..

    RK

  6. #6
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Can we Create user shaped tooltips in VB

    Ravi & Others...

    you might be able to use some of the code from http://codeguru.developer.com/vb/articles/1944.shtml to get and modify the tooltip window.

    This sample show's how to have a true multi-line tooltip control, so once you have the handle, in theory Ravi's idea should work.


    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

  7. #7
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Can we Create user shaped tooltips in VB

    Ah hooooo....

    IT WORKS !:-)

    Just add 2 lines to the code in that article, in the class initialise, after creating the window:


    m_Elrgn = CreateEllipticRgn(0, 0, 100, 100)
    If m_Elrgn <> 0 then
    SetWindowRgn m_hwndTT, m_Elrgn, false
    End If



    with their defs pickedup from API viewer
    and it works.. shows an elliptic tool tip. i guess now we can make any kind of region to work with

    RK

  8. #8
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Can we Create user shaped tooltips in VB

    correction:
    1. Not in Class_initialise but in Create function.
    Public Function Create(frm As Form) As Boolean

    2. You need to do the cleaning up of stuff also
    3. To get a better look more need to be done to adjust the size as per the case.
    That was just a little euphoria.. i am off for the day. bye


    RK

  9. #9
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Can we Create user shaped tooltips: New Article Added

    Yes it is possible, and no need for 3rd party controls.:-)
    ---
    Based on Bred Martinez Code pointed by Chris (look at the complete thread), I expanded the idea and we have added a new page to Code Guru site on this.


    To know what you get, take a look at:

    http://www.codeguru.com/vb/articles/1967.shtml

    Many thanks to Chris Eastwood for his help.

    Ravi Kiran

    RK

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

Featured