Click here to Skip to main content
15,886,137 members
Articles / Multimedia / GDI+
Article

AlphaGradientPanel, an extended panel

Rate me:
Please Sign up or sign in to vote.
4.63/5 (64 votes)
24 Mar 2006CPOL 267.9K   10.5K   122   79
A panel that has rounded borders, gradients, and transparency.

Image 1

Introduction

This is a panel, first of all. Therefore, it has all the advantages of a panel, plus some nice little features.

Using the code

You'll just have to include the component in your toolbox and use it.

The only property that is a bit special is the Colors() property. It is a collection of items and has design-time visibility in the property grid. I'm still trying to achieve transforming the color name that appears in the property grid in a nice drawing... If anybody knows how that can be achieved, please, please, please, let me know ;)

Features

  • Rounded corners (any one of them or all at the same time).
  • Gradients (from 2 to n colors, with some special effects).
  • Transparency (any color can be made transparent with an "Alpha" value between 0 and 255).
  • Borders, even with rounded corners, have a nice little border.
  • Image inclusion (position, opacity, size, grayscale, and padding).
  • Padding of the content, of the back, and of the docking.

History

  • Version 1.0.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Switzerland Switzerland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionHelp Pin
j.channon16-May-06 23:56
j.channon16-May-06 23:56 
GeneralDude, this is tight! Pin
serialc0d310-May-06 3:26
serialc0d310-May-06 3:26 
GeneralRe: Dude, this is tight! Pin
Nicolas Wälti10-May-06 3:31
Nicolas Wälti10-May-06 3:31 
GeneralThanks :) Pin
blroy521127-Apr-06 3:40
blroy521127-Apr-06 3:40 
GeneralRe: Thanks :) Pin
Nicolas Wälti29-Jul-06 6:35
Nicolas Wälti29-Jul-06 6:35 
QuestionAny VS.NET 2003 Version? Pin
Xiaofeizai13-Apr-06 21:29
Xiaofeizai13-Apr-06 21:29 
QuestionHow can i implement this feature on my form Pin
shahrokh_hz8-Apr-06 3:16
shahrokh_hz8-Apr-06 3:16 
AnswerRe: How can i implement this feature on my form Pin
Nicolas Wälti8-Apr-06 22:18
Nicolas Wälti8-Apr-06 22:18 
I'm afraid that this won't be possible AS IS.

Basically, there are several possibilities that would let you kind of mimic this:

You could paint the desktop portion of the form on itself therefore doing like if the form was transparent. But this won't do any good if there are any windows inbetween. (Using the API PaintDesktop() of user32.dll).

You can also set the form background to transparent using a single color, but the controls above, they won't be transparent at all.

You can set the form to a semi-opacity and therefore reach a kind of transparency, but in that case, all your form content will be see-through.

Sorry Smile | :)

Nick
QuestionWhere's the Article? Pin
unklegwar3-Apr-06 3:09
unklegwar3-Apr-06 3:09 
AnswerRe: Where's the Article? Pin
Nicolas Wälti3-Apr-06 5:26
Nicolas Wälti3-Apr-06 5:26 
Generalit is good. Pin
so^fly2-Apr-06 20:23
so^fly2-Apr-06 20:23 
GeneralRe: it is good. Pin
Nicolas Wälti4-Apr-06 7:19
Nicolas Wälti4-Apr-06 7:19 
GeneralSweet! Pin
pablleaf31-Mar-06 3:31
pablleaf31-Mar-06 3:31 
GeneralRe: Sweet! Pin
Nicolas Wälti4-Apr-06 7:19
Nicolas Wälti4-Apr-06 7:19 
GeneralCan't Debug Pin
keith.b30-Mar-06 5:19
keith.b30-Mar-06 5:19 
QuestionRe: Can't Debug Pin
Nicolas Wälti31-Mar-06 0:56
Nicolas Wälti31-Mar-06 0:56 
Generalgreat Pin
dchan7829-Mar-06 0:56
dchan7829-Mar-06 0:56 
GeneralRe: great Pin
Nicolas Wälti31-Mar-06 0:55
Nicolas Wälti31-Mar-06 0:55 
Questiontransparent only to background image on form ? Pin
BillWoodruff28-Mar-06 19:54
professionalBillWoodruff28-Mar-06 19:54 
AnswerRe: transparent only to background image on form ? Pin
Nicolas Wälti28-Mar-06 22:01
Nicolas Wälti28-Mar-06 22:01 
GeneralRe: transparent only to background image on form ? Pin
BillWoodruff28-Mar-06 23:29
professionalBillWoodruff28-Mar-06 23:29 
QuestionRe: transparent only to background image on form ? Pin
Nicolas Wälti29-Mar-06 2:02
Nicolas Wälti29-Mar-06 2:02 
GeneralI can't extract it. Pin
forever06428-Mar-06 16:42
forever06428-Mar-06 16:42 
GeneralRe: I can't extract it. Pin
Nicolas Wälti28-Mar-06 18:08
Nicolas Wälti28-Mar-06 18:08 
GeneralVery Sweeeeeet ! Pin
hammo28-Mar-06 12:59
hammo28-Mar-06 12:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.