RoundButton Windows Control - Ever Decreasing Circles

Round buttons

Introduction

Some time ago, I tried to find a nice round-button control. I couldn't find one, so in the time-honoured tradition, I decided to write my own. I "almost" finished it, but for various reasons, it was consigned to the "come back to it later" category. In its inimitable style, "later" finally arrived, and armed with my shiny new Microsoft Visual C# 2005 Express Edition, I decided to have a crack at finishing it.

Though I say it myself, I think the buttons look nice - you'll have to judge for yourself! They look even better "in the flesh", rather than as the JPEGs in this article.

Background

In my quest for a round button control, I came across a couple of articles (including one by the great man Chris Maunder himself!) which seemed to me and my Very Small Brain to have far too much complicated mathematics involved. Also, I'd been learning about graphics in C#, and doing a lot of experimenting with groovy things like the PathGradientBrush, taking much inspiration from the very excellent Bob Powellsite. Probably, by chance, I forget exactly how, I stumbled upon the idea of layering ever decreasing circles filled withLinearGradientBrushes and PathGradientBrushes one above the other to build up a passable 3-D button. The following images illustrate this:

Hover your cursor for a description

The Button recess onlyThe Button recess with an edgeThe Button recess with an edge and an outer bevel

The Button recess with an edge and both bevelsThe Button recess with an edge, both bevels and a flat topThe Button recess with an edge, both bevels and a domed top

Copy Right http://www.codeproject.com/KB/buttons/RoundButton.aspx

->Read More...

0 Comments:

Đăng nhận xét