Welcome Guest ( Log In | Register )



2 Pages V   1 2 >  
Reply to this topicStart new topic
> VB.NET: How To Create Aqua Buttons, Pulsing & with rounded edges like OS-X
miCRoSCoPiC^eaRt...
post Feb 4 2005, 01:20 PM
Post #1


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411



Hi all,
I'll be brief about it. The original code was NOT written by me - the author is a certain Mr. Dave Peckham whose article titled AquaButton: A sample custom button control with a Mac OS X look can be found at CodeProject.Com. The original code was written in C# though - and my development platform was VB.NET - so I ported the code to VB.NET and here I am posting it for all of you.

    [/tab]If you are unsure what an Aqua Button is - take a look at the following picture:
user posted image

[tab]Right - as you can see this will help you change the look of you .NET applications entirely. For C# you can use the code by the original author - and for VB.NET you can use mine. You'll find all the code needed in the attachment with this post - along with three .png picture files titled:
  • left.png
  • right.png
  • fill.png
    [/tab]These make up the left, right and body of the button. Feel free to relpace these with any other color - try experimenting with different kind of edge shapes and fill body. The fourth file in the zip is the main AquaButton.vb class that will draw the aqua button on your forms. You have to include all 4 files in your project and preferrably leave the .png files in the directory from which your application will run. That is necessary for the code to be able to load the pictures that give the button it's custom shape.

[tab]Only flip side with this is - that the button is not compiled as a User Control and hence not accessible as a Form Designer component. (Maybe, I'll modify it soon to be one). Till then, you have to add the buttons to your project programmatically. A little explanation on that - if you look at the code view of you project (considering a blank form with only one button), inside the "Windows Forms Designer Generated Region", you'll see the standard windows default buttons are added similar to the following format:
CODE

Me.Button1 = New System.Windows.Forms.Button
....
.......
Me.Button1.BackColor = System.Drawing.Color.LightGray
Me.Button1.Location = New System.Drawing.Point (100, 100)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size (60,24)
Me.Button1.TabIndex = 1
Me.Button1.Text = "OK"


    [/tab] If you delete your button in the designer - this code will go away. So make sure you note down the Location and Size of your buttons prior to deletion. Since the Aqua Button class inherits the Windows Button Class - all the default button properties are accessible in the Aqua Buttons too.

[tab]Towards the top of your code, above the windows forms designer generate region add in a statement:
CODE

Friend Withevents Button1 As WildGrape.Aqua.Controls.Button


     Inside your Form_Load procedure add the following statements:
CODE

Button1 = New WildGrape.Aqua.Controls.Button
Me.Controls.Add (Button1)
'The rest is the same as the syntax for the default buttons
Me.Button1.BackColor = System.Drawing.Color.LightGray
Me.Button1.Location = New System.Drawing.Point (100, 100)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size (60,24)
Me.Button1.TabIndex = 1
Me.Button1.Text = "OK"


Compile your code and have fun smile.gif
.:: Cheers ::.

Download the attachment (Zipped with WinZip 9):


Download the attachment (Zipped with Windows Zipper):

Attached File(s)
Attached File  AquaButton.zip ( 6.11k ) Number of downloads: 1198
Attached File  Aqb.zip ( 6.09k ) Number of downloads: 536
 
Go to the top of the page
 
+Quote Post
Ryan
post Feb 28 2005, 03:52 PM
Post #2


Member - Active Contributor
Group Icon

Group: Members
Posts: 87
Joined: 27-January 05
Member No.: 2,360



Interesting code, bit why would you want an aqua button, that makes no sense to me, that would be like if somone created a ipb skin to look like the defualt skin of another BBS. where is the pride of your os to use its buttons?
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post Mar 7 2005, 05:42 AM
Post #3


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411



Don't you get bored by the standard windows buttons ?? That was one of the primary reasons I took the pain to convert this code from C#... But it's not just limited to aqua buttons - if you modify the image files, and a little bit of the code - you can infact put ANY shape/size/color of buttons in your appz. That's the cool part about this code.. I'll try posting a small followup on howto do it. Believe me, it can completely change the look of your app
Go to the top of the page
 
+Quote Post
vizskywalker
post Mar 7 2005, 07:17 AM
Post #4


Techno-Necromancer
Group Icon

Group: Members
Posts: 1,018
Joined: 13-January 05
From: The Net
Member No.: 2,127



I think it is a great idea, and I can't wait for a follow up. Now if only I had a full version of VB instead of the introductory version. Thanks microscopic^earthling.
Go to the top of the page
 
+Quote Post
h3lium
post Aug 10 2005, 06:56 PM
Post #5


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 10
Joined: 10-August 05
Member No.: 7,750



interesting idea, i had never thought of this. do you have the c# code or a link to it?
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post Aug 10 2005, 07:04 PM
Post #6


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411



QUOTE(h3lium @ Aug 11 2005, 01:56 AM)
interesting idea, i had never thought of this. do you have the c# code or a link to it?
*



Look right up on top of the first article. The original C# article that is cited as the C# version of this code is itself the link ..
Go to the top of the page
 
+Quote Post
willytb
post Feb 8 2006, 04:14 AM
Post #7


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 1
Joined: 8-February 06
Member No.: 11,147



Can't seem to unzip the attachment with WINXP unzipper? Do I need a special unzip program?


Notice from miCRoSCoPiC^eaRthLinG:
Please stop quoting a whole post when your feedback is just one line.


This post has been edited by miCRoSCoPiC^eaRthLinG: Feb 8 2006, 05:42 AM
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post Feb 8 2006, 05:44 AM
Post #8


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411



I don't know about WinXP unzipper - I never trusted it much. I packed this file using Winzip v9 - which you can download from http://www.winzip.com Infact it's in version 10 now - but that wouldn't be a problem. I downloaded the file and tested it again - no problem with Winzip or WinRAR (http://www.winrar.com)
Go to the top of the page
 
+Quote Post
warbird
post Feb 8 2006, 10:48 AM
Post #9


Little MechBirdie
Group Icon

Group: Members
Posts: 299
Joined: 23-March 05
From: Down here in Holland
Member No.: 3,178



I tried to unzip it with WinRar but it gives errors all the time:

QUOTE
Unknown method in right.png
Unknown method in fill.png
Unknown method in left.png
Unknown method in AquaButton.vb
No files to extract


Where did you zipped it with? Could you reupload it? plzzzzz *begging* or do you want me to download winzip?

-=jeroen=-
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post Feb 8 2006, 11:31 AM
Post #10


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411



Cool - I've added another ZIP with the same files, this time zipped using Windows default zipper in Normal compression mode. The file is called Aqb.zip - you'll find it attached to the first post.
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Howto: Change Graphical Login To Text(3)
  2. How To: Create PDF With Php(18)
  3. Create Your Own Shout Box(13)
  4. VB: Howto Auto-select Last Item In Listbox(5)
  5. VB.NET: Howto Add And Delete Files(8)
  6. How Do I Create A Good Fire Animation Using Flash ?(13)
  7. Help Needed To Create Login Script With Perl/cgi(21)
  8. Help On Swishmax - Linking Buttons...(6)
  9. How To Create Your Own MSN Winks ?(10)
  10. Create A Site Without Cms But Just Dreamweaver?(6)
  11. Help Me Create A Text-based, Turn-based Game(9)
  12. I Want To Create A PHP Text Based Web Game(5)
  13. Create And Import JavaScript Modules For A Large Script(2)
  14. The Cloning Issue(43)
  15. Can You Create A Folder Name "con"(17)
  1. New Browser Based Game, Create Or Conquer(4)
  2. How To Create A Good Forum(28)
  3. How Do I Create Static Routes In Windows Xp?(11)
  4. Psybnc - Howto(4)
  5. Create Dynamic Gui ?(7)
  6. How To Create Your Own Proxy Site (free And Easy)(13)
  7. Easiest Free Forum To Create Custom Skin For?(2)
  8. Website Navigation Hover Buttons Stick So Made Css Today(7)
  9. How To Create A "user Profile" Page.(0)
  10. How Do You Create A Vista?(21)
  11. Create An Animation With Powerpoint(1)
  12. Create An Ftp Server On Your Pc With Serv-u(1)
  13. What You Need Before You Can Create A Text-based Game..(5)


 



- Lo-Fi Version Time is now: 7th September 2008 - 01:39 AM