By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,772 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,772 IT Pros & Developers. It's quick & easy.

tool tip for variable

P: n/a
Hi,
My application has a rich text box.When i hover the mouse over certain
keywords typed in the text box i want a tool tip to be displayed.Any
idea of how i can accomplish this????
i will be glad if someone can help me plz...

Mar 29 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
ToolTip tt = new ToolTip();

tt.SetToolTip(yourControl, "This is the tooltip");

You can also do this in the designer - see this article:
http://msdn2.microsoft.com/en-US/lib...aa(VS.80).aspx

Josh
http://www.thejoyofcode.com/

Mar 29 '06 #2

P: n/a
Josh Twist wrote:
ToolTip tt = new ToolTip();

tt.SetToolTip(yourControl, "This is the tooltip");

You can also do this in the designer - see this article:
http://msdn2.microsoft.com/en-US/lib...aa(VS.80).aspx

Josh
http://www.thejoyofcode.com/


I think the OP wanted to be able to specify a tooltip for certain
sections of text in the RichTextBox. That would set a tooltip to the
whole control wouldn't it?

Not sure how you *would* go about setting tooltips just for certain bits
of text though.
Mar 29 '06 #3

P: n/a
Hi,

David, you're right, that is what Vinod is looking for.

Vinod...

This link will give you the idea... You will require the EM_CHARFROMPOS
message to get the character under the mouse's position. (InterOp
method)

<http://www.vb-helper.com/howto_richtextbox_word_under_mouse_tooltip.html>

Note : This is a VB 6.0 method, but hopefully you can adapt the syntax
to C#.

Regards,

Cerebrus.

Mar 29 '06 #4

P: n/a

Cerebrus wrote:
[snip]
Note : This is a VB 6.0 method, but hopefully you can adapt the syntax
to C#.


Wow, first time for everything I guess :)

--
Larry Lard
Replies to group please

Mar 29 '06 #5

P: n/a
I clearly misread the post. How embarassing, sorry!

Josh

Mar 29 '06 #6

P: n/a
Larry wrote :
Wow, first time for everything I guess :)


What exactly do you mean, Larry ? I know it can be difficult for some
to convert between languages, but unfortunately it was the only thing I
could find... ;-)

Regards,

Cerebrus.

Mar 29 '06 #7

P: n/a

Cerebrus wrote:
Larry wrote :
Wow, first time for everything I guess :)


What exactly do you mean, Larry ? I know it can be difficult for some
to convert between languages, but unfortunately it was the only thing I
could find... ;-)


Well, I spend more time in the .vb group, and a very common theme there
is that someone has found a C# sample to do X, and needs help
translating it into VB.NET. It's refreshing to see a VB6 sample offered
to a C#er :) But I suppose it makes sense, as the way VB6 people have
had to access the Win32 API for all these years is very close in
feeling to P/Invoke and Interop.

--
Larry Lard
Replies to group please

Mar 29 '06 #8

P: n/a
Hi Larry,

To tell you the truth, I spend most of my time in the VB group too. So
much so, that when I found and was posting the link to the sample, only
then I realized that this question was in the C# group. I thought, "Oh
well... he can convert it if he likes."

BTW, I'm not so fluent with the Win32 API and interop thing, so if you
know any good links where I could learn this...

Regards,

Cerebrus.

Mar 29 '06 #9

P: n/a
Hey Vinod,

Did you actually get this working?

Josh

Mar 30 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.