|
|
Comments and Discussions
|
|
 |

|
Is it possible to use this as a baloon tip?
Thanks
Sam
|
|
|
|

|
I noticed that Dispose() doesn't release all GDI objects.
Try creating a new ToolTip in a loop, while also calling Dispose and GC.Collect() and you'll see that GDI objects are rising without being released.
I think it has something to do with windows messages processing used in the Dispose method.
Can anyone confirm this ?
Is there a fix for this issue ?
|
|
|
|

|
I love this peace of code, wonderfull job, my complements !!
But there is always something extra I need
Is there a possibility to make textlines in the tooltip box with different colors ?
(except the header, that is already possible)
Best Regards, Frank
|
|
|
|

|
Just add the properties..
|
|
|
|

|
can you give a example ...
|
|
|
|

|
There is a Forecolor property, is this what you mean?
|
|
|
|

|
my mistake... I explain it a little more in detail...
I can set the color with ForeColor, like this:
_ttPicBox1.ForeColor = Color.White;
then the whole text line will be the same color. What i want to do is different lines
with different colors, example:
_ttPicBox1.SetToolTip(pictureBox1, "text of line 1, with color 1" + LINE +
"text of line2, with color 2"+ LINE + LINE +
"text of line 3 with color 3" + LINE +
"text of line 4 with color 4"
);
is there a possibility to do that ?
Thnx in advance
Regards, Frank
|
|
|
|

|
This would require serious modification to code, multiple text and forecolor properties.. good luck
|
|
|
|

|
I was hoping that it was simple ....
but thnx for the nice code.
Regards, Frank
|
|
|
|

|
If you use the auto upgrade to convert this to the 2008 format, you will find it no longer works properly. This has nothing to do with the code, but rather a change to the tooltip control implementation. The WM_NOTIFY message in the wndproc uses the NMHDR struct to get notifications on tooltip state changes via the 'code' struct member, in 2008, the 'code' integer always returns 0. I have no idea why this is, or what internal alteration precipitated the change, but I do have a simple fix for the code.
In the WndProc: WM_NOTIFY | WM_REFLECT case, add the following code:
if (IsVisible())
nM.code = TTN_POP;
else
nM.code = TTN_SHOW;
So the beginning of the switch should now look like this:
case (WM_NOTIFY | WM_REFLECT):
NMHDR nM = new NMHDR(0);
RtlMoveMemory(ref nM, m.LParam, Marshal.SizeOf(nM));
if (nM.hwndFrom == _hTipWnd)
{
if (IsVisible())
nM.code = TTN_POP;
else
nM.code = TTN_SHOW;
switch (nM.code)
{
...
|
|
|
|

|
I converted to the 2008 format and did not run into this problem or need to apply your patch. Are you sure the conversion is what caused the problem you observed?
|
|
|
|

|
A really nice control, I've began using it after the windows ToolTip failed me miserably (not too hard to achieve that).
But, I'm having a problem here - I've registered to the RightMouseUp event and:
A. You have a small bug where you actually raise the RightMouseDown event instead (found easily via a Null reference exception).
B. SOMETIMES, can't really figure out yet when - the DrawEventArgs have invalid information, i.e. the Caption and other fields hold junk instead of the info of the clicked ToolTip. I noticed you get this info via a SendMessage but couldn't trace the source of the error.
Any suggestions ?
Thanks,
GP.
|
|
|
|

|
Fantastic article! I have been looking for something like this for a long time.
How can this be put in a DLL so it can be used from VB.NET?
Thank you
Tom
|
|
|
|

|
I really don't know much about vb.net.. but it could be translated, and that would be your best bet.
|
|
|
|

|
are you the one from psc?
Regards,
unruledboy_at_gmail_dot_com
http://www.xnlab.com
|
|
|
|

|
That would be me.. (long time no see enmity)
|
|
|
|

|
I have been here for a long long time, finally got you here codeproject is really a good place, enjoy yourself
Regards,
unruledboy_at_gmail_dot_com
http://www.xnlab.com
|
|
|
|

|
I found the article very interesting and well written, have my 5!
Dr.Luiji
Trust and you'll be trusted.
Try iPhone UI [ ^] a new fresh face for your Windows Mobile, here on Code Project.
|
|
|
|

|
I second that! Interesting and well written, 5 points.
|
|
|
|

|
Hi,
first: thanks for this great control. I would like to to display the tooltip automatically from control load event handler. I tried Show method but it don't work. Is there any way to display control without hovering over bound control?
Regards,
Frank
|
|
|
|

|
This is not what the 'show' command is for, (ex. would be: reshowing after a timeout, or manual mousemove trigger). Much of what is going on with timers and window itself, is being done inside (mfc)tooltip window class, not this hosting class, so mouse must be over control, and it must be visible in order to start timers. Not sure what you are trying to do, (intro window maybe?), but you could create a static window to do it.
modified on Tuesday, December 16, 2008 8:29 AM
|
|
|
|

|
Hi, I'm trying to show a tooltip in a modal dialog window fired from a VS add-in, but the tooltips don't work. Also, on my machine (Vista Ultimate), some of the borders and shadows of the tooltip drift a pixel or two from the tooltip itself. Do you know how it can be fixed?
|
|
|
|

|
Shadows are seperate windows drawn by the system not the tooltip or this class. I am also using Vista ultimate though, and it looks fine here. As for modal window from add in, are you passing in the handle of the dialog or the add in?
|
|
|
|

|
I am passing the handle of the target control to the tooltip, i.e., toolTip.SetToolTip(myButton.Handle, "text")
|
|
|
|

|
I have no idea what control/code you are using so.. what I would do, is set a breakpoint within the wndproc and see what messages are coming through. If messages are absent, then window target message pump might be consuming necessary messages. Also, some windows can not be subclassed, they will return no messages, I can't remember if system dialog is one of them, check msdn.
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
A tooltip replacement class
| Type | Article |
| Licence | CPOL |
| First Posted | 2 Dec 2008 |
| Views | 48,276 |
| Downloads | 1,320 |
| Bookmarked | 189 times |
|
|