Click here to Skip to main content
12,552,801 members (58,793 online)
Click here to Skip to main content
Add your own
alternative version


36 bookmarked

A shiny orb button in GDI+

, 1 Jan 2008 CPOL
Rate this:
Please Sign up or sign in to vote.
A button with a shiny orb effect on mouse hover.


I was actually experimenting with different brush options to create a glassy orb, but it did not work .. But, I still liked the effect even though it wasn't really what I wanted .. So, I turned this into a button. Hopefully, someone may find this useful. When the world is going to WPF ...

Using the code

There aren't many options to play around with except that you can add image, text, and colors.. Do whatever you want with the code, and if you manage to create a shiny glass effect .. let me know. The code is short, and most of the implementation is in the OnPaint method.

The following is used to create the animation effect for the glowing light:

pgb1.FocusScales = new PointF(_focus, _focus);

where pgb1 is the PathGradientBrush.

Then, as a mouse hovers over, it kick starts a timer and increases the focus:

if (_focus < 0.9f)
    _focus = _focus + 0.1f;
else { 

As focus reaches 1, the timer stops.

The reverse occurs when the mouse leaves the control.


  • Version 0.1


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


About the Author

Software Developer (Senior)
United States United States
Senior Software Developer at nextwavesoft

You may also be interested in...


Comments and Discussions

GeneralMy vote of 5 Pin
Member 367289419-Jan-13 11:06
memberMember 367289419-Jan-13 11:06 
GeneralMy vote of 1 Pin
nettai16-Dec-08 21:29
membernettai16-Dec-08 21:29 
Questionhow can i Pin
shahidashraf28-Aug-08 6:56
membershahidashraf28-Aug-08 6:56 
GeneralNot very shiny Pin
King_kLAx2-Jan-08 10:15
memberKing_kLAx2-Jan-08 10:15 
GeneralRe: Not very shiny Pin
sllow2-Jan-08 13:58
membersllow2-Jan-08 13:58 
AnswerRe: Not very shiny Pin
Vartan Simonian2-Sep-08 17:14
memberVartan Simonian2-Sep-08 17:14 

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.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161021.1 | Last Updated 2 Jan 2008
Article Copyright 2008 by Steve-Low-NextwaveSoft
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid