tags:

views:

262

answers:

8

I am just trying to create a form control in winform in .net with custom shaped of balloon shape. There is need of a balloon tooltip which is transparent and I can put buttons on tooltip,but tooltip in .net does not provide facality that we can put the buttons on tooltip control so I want to make a form control looks like a balloon tooltip and so I can put buttons on that form looking like a tooltip.But I cannot show window form control look like a balloon tooltip. So what should I do?? I tried in one way that I create a image in powerpoint of balloon shape and set it to as background image of form property.But there is no solution with that.

+1  A: 

See How to: Create Nonrectangular Windows Forms

KMan
The method in the above article will work, but if you want rounded corners, this will look pretty rough, as there is no anti-aliasing capability here.
Stewbob
+1  A: 

The Control class supports a BackColor with an alpha < 255, it is automatic. It asks the Parent to draw itself to produce the background of the control, then draws itself on top of that. However, you'll want a top-level window for a balloon. That's a window type that can arbitrarily overlap another window and isn't confined by the client area of an underlying window. It has no Parent. A ToolTip is such a window.

The only control available in Windows Forms that can be an top-level window is a Form. Problem is: the transparency trick no longer works. Since a top-level window doesn't have a Parent, there isn't any obvious window to ask to draw the background. It could be many windows, belonging to other processes. You can get transparency in a Form with its TransparencyKey property. But that's a "hard" transparency, equivalent to an alpha of 0. You probably want a soft one. Another nasty problem is that drawing anti-aliased (ClearType) text no longer works since there is no reliable background pixel color anymore.

Long story short: you can't make this work well unless you confine the balloon to the client area of a form. A control, not a form.

Hans Passant
+3  A: 

See Balloon Tips Galore! or Adding Balloon Windows to a .NET Application.

Anton Gogolev
Please add more detail foreach like.
Soul_Master
Why should he do that? They are good links and a good short answer to a short question.
Stormenet
A: 

You can try to hook on the Paint event of the control and draw the Visual of the button there.

Minustar
A: 

Are you looking for custom controls in general? You can always try www.codeproject.com

They have some great source code for what I think you are looking for.

broke
+2  A: 

http://www.codeproject.com/KB/dotnet/EmbCtrlNotIc.aspx might help.

ICR
A: 

Its not c# but can be of some help. : Create an Irregular shaped Windows Form with VB.NET

Shoban