Click here to Skip to main content
15,887,477 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 268.1K   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

 
GeneralVery Sweeeeeet ! Pin
hammo28-Mar-06 12:59
hammo28-Mar-06 12:59 
GeneralRe: Very Sweeeeeet ! Pin
Nicolas Wälti28-Mar-06 18:09
Nicolas Wälti28-Mar-06 18:09 
GeneralLooks great Pin
James N24-Mar-06 19:31
James N24-Mar-06 19:31 
AnswerRe: Looks great Pin
Nicolas Wälti24-Mar-06 21:54
Nicolas Wälti24-Mar-06 21:54 
GeneralNice! Pin
Vertyg024-Mar-06 6:25
Vertyg024-Mar-06 6:25 
QuestionRe: Nice! Pin
Nicolas Wälti24-Mar-06 6:55
Nicolas Wälti24-Mar-06 6:55 
AnswerRe: Nice! Pin
Vertyg024-Mar-06 6:59
Vertyg024-Mar-06 6:59 
GeneralRe: Nice! Pin
philippe dykmans24-Mar-06 12:53
philippe dykmans24-Mar-06 12:53 
Hello,

Well, not to say i'm an expert. But looking at what the static functions do, i can't think of any situation where they would ever be unsafe. There are many discussions about the good and the bad of static functions. Some consider them as not well-object-oriented. But i still believe in them, actually. Suppose i'm writing a very complicated and fat class. And suddenly i need to have a very simple function of a very general nature. Something of which i think that i could use it later and totally out of the context of the complex class too. Then, what do i do next time i need it? Instantiate the big class just to have it perform a simple function? And what class was that again? Or do i implement it all over again in the new class? Duplicating code and introducing bugs again? No. I better put it aside from the start. So there's only one place where i have to go if it goes wrong. As a static function in its own class. Where i can easily find it wherever i am. I think we're all very happy that a silly string concatenation is defined as a static somewhere. So nobody would ever come to the stupid idea of instantiating a webservice object because he knows that it has a function to concatenate strings. Or that he would implement it again. Suppose every class would have to have her own private function to concatenate strings. Would be quite bloating huh?

But this is not meant as a critic on Vertig0. It's just an idea i have.

And about the dispose; not every object needs a Dispose. Because you don't need Dispose to get rid of an object. You need Dispose to give that object the chance to free unmanaged resources and stuff. If the class does not allocate any unmanaged resources, there's no big need for a Dispose.

And a very nice project by Nick Wealty, by the way. It looks great! Compliments!

Grtz,
Phil

Philippe Dykmans
Software developpement
University of Antwerp
GeneralRe: Nice! Pin
Nicolas Wälti24-Mar-06 22:02
Nicolas Wälti24-Mar-06 22:02 

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.