?
Solved

How to change Tooltip shape

Posted on 2007-10-14
10
Medium Priority
?
1,327 Views
Last Modified: 2008-01-09
I have such a code which works fine
        ToolTip t = new ToolTip();
        t.ToolTipIcon = ToolTipIcon.Info;
        t.ToolTipTitle = "eVerifySMS";
        t.Show("Data Saved", pnlChangeProfile, new Point(50, 50), 1000);
it shows a tooltip at a specified position with needed text, however I don't like the Rectangle shape. I'd like to have it an Ellipse. How do I do this? Also would like to change the background color. Is it possible?
Thx
0
Comment
Question by:EugeneSLO
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 21

Expert Comment

by:surajguptha
ID: 20075059
From what i know, the rectangular tooltop is what is provided by default. You will have to either code a custom tooltip class or buy a third party tool tip library.
0
 
LVL 30

Expert Comment

by:anarki_jimbel
ID: 20075069
This is very simple solution for "balloon" shape.
http://www.codeproject.com/cs/miscctrl/Balloon_ToolTip.asp?df=100&forumid=176729&exp=0&select=1154254

There are some components you can buy:
http://www.componentsource.com/features/tooltips/visual-csharp-net/index.html

There are some examples how to create custome tooltips with extended functionality:
http://www.vbforums.com/showthread.php?s=&threadid=297009 (Visual Basic)

Use ready dll:
http://www.freevbcode.com/ShowCode.asp?ID=1232
0
 

Author Comment

by:EugeneSLO
ID: 20075071
isn't there a way to derive from original Tooltip and override OnPaint or something like this?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 21

Expert Comment

by:surajguptha
ID: 20075092
Yes that would be as good as developping a custom tooltip. Yes it can be done.
0
 

Author Comment

by:EugeneSLO
ID: 20075109
any snipets of code for overriding original tooltip?
0
 
LVL 21

Accepted Solution

by:
surajguptha earned 1000 total points
ID: 20075113
Try this
protected override void OnPaint(PaintEventArgs e)

{

      base.OnPaint (e);

      e.Graphics.Clear(this.BackColor);

      Rectangle textRect = this.ClientRectangle;

 

      textRect.X = 3;

      //textRect.Y = 2;

      textRect.Width += 2;

      textRect.Height += 2;

 

      e.Graphics.DrawString(this.Text, this.Font, textBrush, textRect);

 

      this.DrawBorder(e.Graphics);

}

I got this from http://blog.opennetcf.org/ayakhnin/PermaLink.aspx?guid=4d82068f-0b25-4b01-825d-4dffb0335817
0
 
LVL 21

Expert Comment

by:surajguptha
ID: 20075126
Also there is no class like Rectangle for an ellipse so you might want to draw it using a Graphics.DrawEllipse(overloads) and see if u can fit that in to the above code.
0
 
LVL 30

Assisted Solution

by:anarki_jimbel
anarki_jimbel earned 1000 total points
ID: 20075261
While examples below are not exactly what you want you may find some ideas on implementing:

http://dotnetslackers.com/articles/net/SuperToolTip.aspx

http://www.codeproject.com/miscctrl/CustomToolTips.asp
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20294963
Forced accept.

Computer101
EE Admin
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Integration Management Part 2
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question