Groups | Blog | Home
all groups > vb.net controls > july 2005 >

vb.net controls : Anyone know how to change color for a 3D button like this button control does?


TonyVal - MSDN News
7/11/2005 12:00:00 AM
Hi All,

Anyone know how to change color for a 3D button like this button control
does?
http://www.econtechvn.com/en/aquabutton_detail.htm
I see it is really cool. But, don't know how to do that.

Thanks,
TonyVal

Pramod
7/11/2005 12:00:00 AM
hi,
i think u need to download those buttons if u want them
i still dont see any method in C# .Net for this

Rgds
Pramod




[quoted text, click to view]

Thomas Wenning
7/11/2005 12:00:00 AM

"TonyVal - MSDN News" <tonyval_2002@yahoo.com> schrieb im Newsbeitrag
news:%23VxYrGfhFHA.2560@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

Hi Tony,

look hier:
http://www.codeproject.com/cs/miscctrl/aquabutton.asp

Greeting

Thomas Wenning

TonyVal - MSDN News
7/12/2005 12:00:00 AM
Thank you. I read this code arealdy.
But this don't tell me how to change color of the button.

Regards,


[quoted text, click to view]

Mick Doherty
7/12/2005 9:32:13 AM
You are basicly going to have to ownerdraw the button. I have only ever seen
examples of Aqua buttons using bitmaps, but I'm sure it's possible to create
them through GDI+.

There is an example of a customised Button on my site, but you'll need to
implement your own Aqua appearance.
http://dotnetrix.co.uk/buttons.html

You also have the option of drawing Lite Buttons by using a Library such as
VG.Net:
http://www.vgdotnet.com/custom_ui.shtml

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


[quoted text, click to view]

Frank Hileman
7/12/2005 10:40:17 AM
This is a rough explanation of the technique you would use if you do not
want to stretch a bitmap.

If you read this:
http://weblogs.asp.net/frank_hileman/archive/2004/10/29/249637.aspx

It explains how to draw a gel ellipse, which is similar to a gel button. The
difference is the FocusScaling property value for a rectangle would be
changed in the x dimension to stretch the inner color, as in these examples:
http://www.vgdotnet.org/forums/viewtopic.php?t=194

Generally you want to stretch the inner color till it touches the center of
the circle defining the curved portion of the button on the left and right
sides. The focus scaling is a fraction of the total width. So if the radius
is 50, and your total button width is 200, your focus scaling in the x
dimension would be
(200 - 2 * 50)/200 = .5

The shine fill is more complex if you want to use a different x and y radius
for that.

My explanations are for VG.net but the properties map to GDI+.

Regards,
Frank Hileman

check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor

[quoted text, click to view]

AddThis Social Bookmark Button