Important alert: (current site time 7/15/2013 7:35:17 AM EDT)
 

winzip icon

FreeStyle Button [Button with skins/themes]

Email
Submitted on: 6/1/2005 10:08:43 AM
By: Rehan R. Dalal  
Level: Advanced
User Rating: By 52 Users
Compatibility: VB.NET
Views: 37741
author picture
 
     This is a new button control which is completely user-drawn. It can be expanded to easily included more and more themes. Currently there are nine themes (LiquidChromeXP, WindowsXP, SoftGlassXP, MSNLoginButton, Aqua, 3DHover, OfficeXP, Office2003 and Macintosh). Of these 5 can take up any color (as specified by you through the ThemeColor Property) and will automatically redraw with the correct color. In addition to this the themes also have text effects like shadows and bevels which can be turned on and off. Presently there is no support for images however I am writing code for the next version which will support them. In addition to all this it comes with a custom written module for multiple color manipulatory functions which can return the resulting color for color mixes (using such blend modes as soft light, overlay, screen and multiply : such as in Adobe Photoshop) and also color invertion and HSB2RGB Conversion.

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
6/1/2005 11:49:13 AMRehan R. Dalal

Comments are greatly appreciated. If you like it please VOTE!!!
(If this comment was disrespectful, please report it.)

 
6/2/2005 9:28:19 AMRehan R. Dalal

Thanks for all the votes!
(If this comment was disrespectful, please report it.)

 
6/2/2005 5:53:52 PMXeon Productions

Excellent, this deserves 5 globes.
(If this comment was disrespectful, please report it.)

 
6/3/2005 2:35:51 AMRehan R. Dalal

Thanks man...
(If this comment was disrespectful, please report it.)

 
6/8/2005 5:27:48 AMPhantom Man

Well Done Rehan, Nice Intuative And Well Made Control.

I Can't Wait To See Your Updates.

Thanks For Sharing.

Regards
Gary
(If this comment was disrespectful, please report it.)

 
6/8/2005 11:51:57 AMRehan R. Dalal

Well the updates gonna come hopefully very soon with better drawing functions and more themes...

Thanks for the globes...
(If this comment was disrespectful, please report it.)

 
6/20/2005 6:42:40 AMAlaeddin Hallak

looks very good!!! 5 stars!
(If this comment was disrespectful, please report it.)

 
6/25/2005 1:01:27 PMAndrea Minganti

That's a great piece of code, keep up the good work!

(And dont forget to update :P)
(If this comment was disrespectful, please report it.)

 
7/1/2005 3:03:20 PMARichardson

i am missing a reference and can't find it in my standard list...where can I get ShdocVw?

(If this comment was disrespectful, please report it.)

 
7/2/2005 6:54:21 AMRehan R. Dalal

ShdocVw is not required by this project at all... It was originally placed as a reference to allow placing of a web browser on one of the forms.. I had forgotten to remove the reference... I will correct this in the next upload...
(If this comment was disrespectful, please report it.)

 
7/4/2005 4:41:30 AMJames H.

I'm very impressed. Another 5 globes for you :)
(If this comment was disrespectful, please report it.)

 
7/21/2005 12:04:09 PMAníbal Svarcas

Hi,
This is a great work!
I noticed that in the 'Aqua Theme/FillPill method/Circle case', the drawing line doesn't draw the border of the circle correctly on the right side. Try replacing with the following line, and the border of the circle will draw itself completlly (try it and watch the right side of the circle)

e.Graphics.FillEllipse(b, New Rectangle(rect.X, rect.Y, RECT.WIDTH - 1, rect.Height))
(If this comment was disrespectful, please report it.)

 
7/24/2005 3:50:07 AMArvin Meralpis

nice. 5 globes from me
(If this comment was disrespectful, please report it.)

 
9/7/2005 5:35:59 AMKon Phanphengdy

Nice work, thanks for sharing.
5 marbles mate.

(If this comment was disrespectful, please report it.)

 
10/2/2005 4:37:24 PMSecrets

nice work! keep it up
(If this comment was disrespectful, please report it.)

 
10/20/2005 7:51:51 PMJorge Bastos

Hi there,
I have 2 questions to you, this code i've found here is great! Just what i needed but i have 2 problems, the 1st one is that i cannot do the same i do in the standard .net buttons, putting the text like button1.text = "&Save" to add "S" as shortcut, and the secund is, when the button is selected, if i hit enter it doesn't do the click event, only if i hit the space key, are there any parameter for this or this version works like this?
The version of fsbutton.dll is 1.0.2119.41403

Hope you can help and give a quick feedback.
Thanks in advanced,
Jorge Bastos
(If this comment was disrespectful, please report it.)

 
1/30/2006 9:54:54 AMMassimo

For anyone interested, I created Vista Skin for the button and for those that want the shortcut to work, Add this line of code to the DrawText() method

sf.HotkeyPrefix = Drawing.Text.HotkeyPrefix.Show

(If this comment was disrespectful, please report it.)

 
4/12/2006 1:58:46 PMAnkit Verma

Great Buttons. Which i ever seen in my life
(If this comment was disrespectful, please report it.)

 
4/17/2006 12:41:32 PMOmar Alejandro Jonguitud Zamora

Jorge, about your first question. If you want to catch a key other than the space just check the OnkeyUp() and onkeydown() methods. Add the code to responde to keys.return and the keycode = 13 (return) and your first problem would be solved. Hope it helps.
(If this comment was disrespectful, please report it.)

 
6/7/2006 2:50:50 AMKarel

Great article, excellent code! Using themes by your way is great idea. I vote 5 globes.
(If this comment was disrespectful, please report it.)

 
6/17/2006 12:38:06 AMxprepairpro

i was wondering if this is limited to only buttons? maybe you could do an example of other items. tabpags?

toolsrips? menustrips?

ive just started looking at the code so i havent gotten to much into it. i definately like what i see though. 5 stars here
(If this comment was disrespectful, please report it.)

 
7/18/2006 8:57:37 AMCory

I couldn't run this in VS 2005.
(If this comment was disrespectful, please report it.)

 
8/17/2006 10:41:04 AMJ Retief

Fantastic work. Well done. Could I be as bold as to ask if it will be possible to translate into C#?
(If this comment was disrespectful, please report it.)

 
9/3/2006 1:37:26 AMVBNewComer

Have any controls for VB forms too ?, Just downloaded your code but not evaluated yet.
(If this comment was disrespectful, please report it.)

 
12/11/2006 10:19:49 AMClaus Thomsen

Why do I always get this error: "One or more projects failed to convert. These projects are now unloaded and marked as unavailable in the Solution Explorer. Reload those projects to determine the cause." ? :/
(If this comment was disrespectful, please report it.)

 
2/15/2007 2:47:56 PMKeri Londonl

Awesome!!! Love it!!!
(If this comment was disrespectful, please report it.)

 
3/6/2007 10:02:34 AMayman metwally

Me too :
I couldn't run this in VS 2005 !
(If this comment was disrespectful, please report it.)

 
3/6/2007 10:06:01 AMayman metwally

OK, I removed all SHDocVw.InternetExplorer and its related staff ..

Works good now ..

And its time to vote: (Excellent of course)

(If this comment was disrespectful, please report it.)

 
3/8/2007 3:06:05 AMMohammad AlSayeh

hi there

the buttons are extraordinary but I would like to know how to place a background image for the control and let the background image take the shape of it

thanks in advance
(If this comment was disrespectful, please report it.)

 
7/19/2008 9:50:29 AMsaid ammir

good job thx and good luck
(If this comment was disrespectful, please report it.)

 
12/4/2008 4:20:11 AM

Good good !
(If this comment was disrespectful, please report it.)

 
1/15/2009 2:16:14 AMSunil

This is one of the best article
thanks a lot
keep the good work
(If this comment was disrespectful, please report it.)

 
2/18/2009 12:34:10 AMNil

Great button. Thanks!
(If this comment was disrespectful, please report it.)

 
1/4/2011 2:29:13 PMMedaco

Nice Button, good work
(If this comment was disrespectful, please report it.)

 
1/16/2011 6:33:48 PMKarl

Is this button free to use in commercial applications ?

Regards.
(If this comment was disrespectful, please report it.)

 
6/17/2011 6:20:30 AMManuel

Great work !!!. Thanks for sharing it with us
(If this comment was disrespectful, please report it.)

 
6/25/2011 11:47:09 AMMJ

Hi! Great control, but when I create it in execution time, I can´t change themecolor. What can I do?
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.