Multiple lines in a ToolTipText

Is there a way to get multiple lines in a ToolTipText for a control ?

I've tried with   vbcrlf, chr$(10) , chr$(13) , chr$(10) + chr$(13), chr$(13) + chr$(13), ....

So, what I want is a tooltip like this one :

   You have two choices :
   Press <Enter> to accept or
   press <Esc> to cancel
LVL 4
vindevogelAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mcriderCommented:
Unfortunately, tooltiptext is a "one-liner".  If you want to get around this, you have to build your own tooltips or use 3rd-party OCX.

Cheers!
0
vindevogelAuthor Commented:
McRider : I have the habit of rejecting answers to questions I post who are just saying "You can't"

This may be so .... (that I can't)

What I want is that this question remains open for some time, so people can give me ideas on how to do it.  Something like, "add 1000 spaces, he'l automatically give you a new line then ..."

Last week, I had the same thing.
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=10223034 
I got a negative answer in 5 minutes, and a solution one hour later !!

If no-one gets me an answer I'll reward the points anyway, don't worry.
0
JuiletteCommented:
You can't have multiline tooltips but you can use the tag tip in place of the tip.
it works like this.

'create multil line tag tips...same use as tool tips except
'that with tool tips you are restricted to one line..
'with tag tips you get multiline
'remember to set the height and width of your label to fit your
'message
'
'this example uses a command button (command1) & a label (label1)
'
'on mouse over the command button the tool tag is displayed
'
Private Sub Form_Load()
   
   Label1.BackStyle = 0    'or 1 and set the backcolor to tooltip color
   Label1.Visible = False
   
End Sub

Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
     
     Dim msg$
     msg$ = "Tag tips for the beginner." & vbCrLf
     msg$ = msg$ & "Multil Line Tag Tips Made Easy" & vbCrLf
     msg$ = msg$ & "Think of the possibilities!"
         
     
     Command1.Tag = msg$

     Label1.Caption = Command1.Tag
     Label1.Top = Command1.Top + Command1.Height
     Label1.Left = Command1.Left + Command1.Width / 2
     Label1.Visible = True
     
End Sub


Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
   
   Label1.Visible = False
   
End Sub
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

vindevogelAuthor Commented:
Heheh ... Juliette is back :-)

Sorry Juliette this time. I'll reject for the same reason.  Your workaround is great, but that I could figure out myself too.

To be fare : I need tooltips in both VB and on HTML pages. (Like on images)

(I try to write components to do most of my stuff, both usuable in VB as in HTML/ASP)

I would prefer one method to do it, and with standard stuff.
With your option I would have to find a method do that in HTML too ...

Same for RCRider as you: I'm willing to give you guys the points, but would have to give a "D".  I take pride in my gradings, hope you do too.
0
vindevogelAuthor Commented:
fare = fair
0
mcriderCommented:
vindevogel,

Juilette has provided the same answer I did, except Juilette provided an example of "building your own tooltips" by using a label.

Cheers!
0
vindevogelAuthor Commented:
mcrider : I know, that's why I rejected too .....
0
mcriderCommented:
This is why it can't be done without doing it yourself...

First look at this microsoft "C" KB article... It describes doing multi-line tool tips in C.

http://msdn.microsoft.com/library/sdkdoc/shellcc/commctls/tooltip/tooltip.htm


 Now, the document states you have to respond to "a TTN_GETDISPINFO notification message... To force the tooltip control to use multiple lines, send a TTM_SETMAXTIPWIDTH message" using SendMessage...

Unfortunately, the tooltip event is fired internally to visual basic and is outside the control of your program.  


Cheers!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mcriderCommented:
By the way, grading an answer like this with a "D" is really not fair... I had nothing to do with microsoft's creation of VB... Basically, giving a "D" is shooting the messenger...

Cheers!
0
vindevogelAuthor Commented:
No, grading your second answer as a D, would not be fair, I admit.

On your first answer, however, it would be.  I think.

The document is now on the printer.  I'll read it through.

I'm thinking two things now : I either give you the credits on this question (50p A), or I raise the points to this question to 150-200 to get me a way to trap the message (like with messagehook)
0
mcriderCommented:
Like I said, the event is fired internally to VB, you would have to watch windows events using a timer control, and I'm not sure this would even work...

Cheers!
0
vindevogelAuthor Commented:
No no, mc, you don't watch windows events with a timer !!

I'm not going to raise the points.  I'll find another way (maybe the workaround in VB, some other stuff in ASP)

I promised the A, so you get it.
Would have given you a B though, if I hadn't promised.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.