|
-
Mar 17th, 2007, 08:21 AM
#1
Thread Starter
Addicted Member
[2005] Tooltip with image
Is it possible to show a System.Drawing.Image inside a ToolTip?
thanks in advance
Home is where your Head is
-
Mar 17th, 2007, 07:05 PM
#2
Re: [2005] Tooltip with image
Not as is. You'd have to inherit the ToolTip class and add the functionality yourself. It may require API calls to access the Win32 object underneath or you may be able to just use GDI+.
-
Mar 17th, 2007, 07:24 PM
#3
Re: [2005] Tooltip with image
JM, I think this be done with OwnerDraw set?
This requires a sub to draw the tooltip (using GDI+). I have only ever used this method to show a tooltip with text in different colors. But since the tooltip draw event has a drawing surface, I think any graphics object should be permissible?
I don't have access to my apps code at present, but I made my custom tooltip based on the example at...
http://msdn2.microsoft.com/en-us/lib...ownerdraw.aspx
Edit: I just ran up the example and including an e.Graphics.DrawImage in the draw event and does display an image.
Last edited by Bulldog; Mar 17th, 2007 at 07:37 PM.
-
Mar 17th, 2007, 07:39 PM
#4
Re: [2005] Tooltip with image
Should have looked at the doco since 2003 shouldn't I.
-
Mar 17th, 2007, 08:13 PM
#5
Re: [2005] Tooltip with image
Hey, no problem. It's not very often I get to educate a guru!
Actually in your signature, you used to have a link to some free controls, I seem to remember that one of those was an enhanced tooltip that may be easier for dani2 to work with. Do you have the link for that? I've forgotten the vendors name, but they were in Aus. (It was a name something like Quantas).
-
Mar 17th, 2007, 08:28 PM
#6
Re: [2005] Tooltip with image
Those components were for .NET 1.1 and simply provided access to features of the underlying Win32 component that Microsoft have now added to .NET 2.0. Having looked at the doco I don't see it getting much easier than setting OwnerDraw to True and handling the Draw event.
-
Mar 18th, 2007, 02:10 AM
#7
Thread Starter
Addicted Member
Re: [2005] Tooltip with image [RESOLVED]
thanks guys.
e.Graphics.DrawImage did the trick
Home is where your Head is
-
Mar 18th, 2007, 03:08 AM
#8
Addicted Member
Re: [2005] Tooltip with image
Hi,
Can you post example of code ?
Thanks in advance
-
Mar 18th, 2007, 03:11 AM
#9
Re: [2005] Tooltip with image
 Originally Posted by yulyos
Hi,
Can you post example of code ?
Thanks in advance
You already know that you have to set the OwnerDraw property to True, handle the Draw event and call the e.Graphics.DrawString method. It should not be a big step from there to read the documentation for that method and see what options are available to you. You can even just start typing and Intellisense will tell you what overloads of the method there are and what arguments each has.
-
Mar 22nd, 2007, 10:06 AM
#10
Addicted Member
Re: [2005] Tooltip with image
Hi,
Can you post example of code ?
Thanks in advance
-
Mar 23rd, 2007, 09:42 AM
#11
Addicted Member
Re: [2005] Tooltip with image
Hi,
My opinion is, if someone posts a question on a public forum like 'VBFOURM' this question becomes a public question.
If the person that ask the question accept to get answers from people from all the world,
this person also need to accept to share with others the solution of his question.
In this thread I asked twice and privet message also.
Anyway I found a link to the solution 'ToolTip with image' with big help
from a person named Rod Stephens from www.vb-helper.com and the link is:
http://www.vb-helper.com/howto_2005_...w_tooltip.html
-
Mar 23rd, 2007, 10:04 AM
#12
Re: [2005] Tooltip with image
Well as I see it, the purpose of this forum is to help people learn programming, not just giving code. Jmcilhinney told you exactly what you needed to do to write the code yourself, if there was something that wasnt clear to you, you should ask about it.
Last edited by Atheist; Mar 23rd, 2007 at 10:08 AM.
-
Mar 23rd, 2007, 10:26 AM
#13
Addicted Member
Re: [2005] Tooltip with image
Hi,
To Atheist:
Look at your siganture:
Any code example from me is in VB2005
-
Mar 23rd, 2007, 10:34 AM
#14
Re: [2005] Tooltip with image
Yes? Whats your point?
We do give code examples around here, but definitly not if you dont try for yourself first. Why couldnt you just try to do what jmcilhinney told you? If you wouldve done that, but still couldnt make it work, you couldve told us your problem and we wouldve helped you. Even given you code example if it was needed.
If a programmer just copies and pastes code into his application from sites, does he learn anything? Perhaps, but very little.
-
Mar 23rd, 2007, 10:53 AM
#15
Addicted Member
Re: [2005] Tooltip with image
Hi,
To Atheist:
Look the dates between my two requests to some code.
Believe me I tried.
-
Mar 23rd, 2007, 11:11 AM
#16
Re: [2005] Tooltip with image
yolyos,
What these forum members are saying to you, is that if you read over the conversation that took place in this thread before your first post in it, all the pieces to put the puzzle together are there.
So if you take all the advice that was already given to the guy who started this thread, you should be able to put together some code on your own to get it working. If you try, but can't get it working, then you should post what code you tried to use, and some of the knowledgable members will likely assist you by making corrections and suggestions to your code.
Most of the more advanced members of public forums like this, also have jobs and other things going on, and while they COULD make a code example, they don't always have time to. On the other hand, you trying it yourself, and posting back with specific questions when you can't get it working, is much more benefitial to you, because you will get answers faster, and also learn more in the process.
-
Mar 23rd, 2007, 11:18 AM
#17
Re: [2005] Tooltip with image
 Originally Posted by yulyos
Hi,
To Atheist:
Look the dates between my two requests to some code.
Believe me I tried.
Then show us the code you have, and we'll help you from there. As Kleinma says its the fastest way for you to get help.
Im not trying to be a pain in the ass but there are just too many people that never learns anything for themselves, they just get on here and ask for code all the time. And I'm not saying you're one of them, but there you have my reason for not just giving away code examples.
-
Mar 23rd, 2007, 11:31 AM
#18
Addicted Member
Re: [2005] Tooltip with image
Hi,
From all forums that I know the most of them that I like is this forum.
All I'm saying is: please a little help, that's all.
You can enter http://yulyos4vbnet.spaces.live.com it is in my signature; I'm a person that likes to share my code with everyone.
-
Mar 23rd, 2007, 01:25 PM
#19
Re: [2005] Tooltip with image
If you look at the third posting (which was mine), a link to an example is already given. If you add e.Graphics.DrawImage into the draw event of that example, then you have the code.
Of course, you should read up on the subject, rather than just copying the example, otherwise you won't learn anything.
-
Mar 23rd, 2007, 01:38 PM
#20
Addicted Member
Re: [2005] Tooltip with image
Hi,
In china there more then 400 letters
For the Chinese people it's very easy.
-
Mar 23rd, 2007, 01:51 PM
#21
Re: [2005] Tooltip with image
 Originally Posted by yulyos
Hi,
In china there more then 400 letters
For the Chinese people it's very easy.
Seems to me like you dont want to be helped.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|