[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

BeeJ

4/7/2012 9:54:00 PM

The Properties Dialog allows longer tooltip text that an actual visible
tooltip. i.e. it truncates it.
Is there a way to extend the visual tooltip to match what is in the
properties tooltip?

If not, what other ways are there to display a tooltip for each panel?
I mean is there an API call that can do it?
Rather not have to construct a tooltip from scratch. e.g. a floating
tooltip form.

I noticed as I Googled this, many VB6 possible solutions from several
existing forums have evaporated. Maybe the WayBack machine has it but
I'm too tired to hop in the time machine.

--
Noah's Ark was built by amateurs,
The Titanic was built by professionals.
Row, row, row your boat gently down the stream ...
Life is but a dream!


2 Answers

Mike Williams

4/8/2012 1:41:00 PM

0

"BeeJ" <nospam@spamnot.com> wrote in message
news:jlqd0n$3hm$1@speranza.aioe.org...
>
> The Properties Dialog allows longer tooltip text that an
> actual visible tooltip. i.e. it truncates it. Is there a way
> to extend the visual tooltip to match what is in the properties tooltip?
> If not, what other ways are there to
> display a tooltip for each panel? I mean is there an
> API call that can do it? Rather not have to construct
> a tooltip from scratch. e.g. a floating tooltip form.

There are various messages you can send in order to control all aspects of a
tooltip window you have created yourself, for example TTM_SETMAXTIPWIDTH,
but I don't think you can easily override the behaviour of a standard VB
tooltip window in that way, especially for the individual Panels of a
StatusBar Control where there is actually only one window involved (the
StatusBar's own hWnd property) and where the individual panels are all part
of that single window and are not individual windows in their own right.
Therefore whatever you do, even if you find a way of subclasssing the
StatusBar to achieve what you are after or subclassing the Form on which it
sits, you will still need to include code to determine which panel is
involved at any specific time.

One easy way of 'almost achieving' the effect I think you are after without
resorting to complicated code would be to leave the StatusBar's ToolTipText
and all the individual Panel ToolTipTexts as empty strings and to instead
place your desired texts into the Tag properties of the individual StatusBar
Panels. This would then enable you set use some very simple code to
automatically set the StatusBar's ToolTipText (which is not restricted in
size) so that it displays the Tag property of whatever Panel the mouse is
over. Try something like the following:

Private Sub StatusBar1_MouseMove(Button As Integer, _
Shift As Integer, x As Single, y As Single)
Dim p As Long
For p = 1 To StatusBar1.Panels.Count
With StatusBar1.Panels(p)
If x >= .Left And x < (.Left + .Width) Then
StatusBar1.ToolTipText = .Tag
End If
End With
Next p
End Sub

The above is just some simple test code and there is probably a neater way
of writing it but it does solve your problem insofar as it allows you to
display individual Panel tooltips without the limited width restriction that
would otherwise be the case but it does have one small problem in that the
'tooltip delay' between one panel and the next as the user moves the mouse
across the Panels of the ToolBar is zero (although the initial tooltip delay
is fine). It is only a quick 'knock up' though and there may be a way of
adding a little extra code to add the delay between panels. I haven't looked
at that aspect yet, but if it is anything close to the solution you require
then you will probably be able to add that yourself.

Mike



BeeJ

4/8/2012 3:32:00 PM

0

I can work with that.
Thanks Mike!