|
|
|
|
![]() ![]() |
Feb 4 2005, 01:20 PM
Post
#1
|
|
|
PsYcheDeLiC dR3aMeR 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: ![]() [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:
[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 .:: Cheers ::. Download the attachment (Zipped with WinZip 9): Download the attachment (Zipped with Windows Zipper):
Attached File(s)
|
|
|
|
Feb 28 2005, 03:52 PM
Post
#2
|
|
|
Member - Active Contributor 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?
|
|
|
|
Mar 7 2005, 05:42 AM
Post
#3
|
|
|
PsYcheDeLiC dR3aMeR 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
|
|
|
|
Mar 7 2005, 07:17 AM
Post
#4
|
|
|
Techno-Necromancer 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.
|
|
|
|
Aug 10 2005, 06:56 PM
Post
#5
|
|
|
Newbie [ Level 2 ] 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?
|
|
|
|
Aug 10 2005, 07:04 PM
Post
#6
|
|
|
PsYcheDeLiC dR3aMeR Group: Admin Posts: 2,242 Joined: 29-January 05 From: Nakorn Chaisri, Thailand Member No.: 2,411 |
|
|
|
|
Feb 8 2006, 04:14 AM
Post
#7
|
|
|
Newbie [ Level 1 ] 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 |
|
|
|
Feb 8 2006, 05:44 AM
Post
#8
|
|
|
PsYcheDeLiC dR3aMeR 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)
|
|
|
|
Feb 8 2006, 10:48 AM
Post
#9
|
|
|
Little MechBirdie 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=- |
|
|
|
Feb 8 2006, 11:31 AM
Post
#10
|
|
|
PsYcheDeLiC dR3aMeR 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.
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 7th September 2008 - 01:39 AM |