• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1438
  • Last Modified:

How to change Tooltip shape

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
EugeneSLO
Asked:
EugeneSLO
  • 4
  • 2
  • 2
  • +1
2 Solutions
 
surajgupthaCommented:
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
 
anarki_jimbelCommented:
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
 
EugeneSLOAuthor Commented:
isn't there a way to derive from original Tooltip and override OnPaint or something like this?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
surajgupthaCommented:
Yes that would be as good as developping a custom tooltip. Yes it can be done.
0
 
EugeneSLOAuthor Commented:
any snipets of code for overriding original tooltip?
0
 
surajgupthaCommented:
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
 
surajgupthaCommented:
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
 
anarki_jimbelCommented:
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
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now