Jump to content



Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!

Toggle shoutbox Shoutbox Open the Shoutbox in a popup

@  agyat : (23 May 2013 - 01:23 AM) Wow! Mr. Sb Back Home.
@  OpaQue : (23 May 2013 - 12:44 AM) Ting
@  OpaQue : (24 April 2013 - 02:44 PM) I guess, Time to run Mycent script.
@  OpaQue : (24 April 2013 - 02:43 PM) wow.. not much spam. except habatt posting lot of links.. :P
@  yordan : (23 April 2013 - 01:04 PM) You're welcome, agyat. Nice to have been helpful. Second lesson: try full words, "you" instead of "EW".
@  agyat : (23 April 2013 - 05:03 AM) @YORDAN: tHANK EW FOR YOUR FIRST LESSON.   :D
@  yordan : (22 April 2013 - 09:43 PM) @agyat : "why don't you help me", or "please help me", or "please teach us"
@  yordan : (22 April 2013 - 09:42 PM) welcome back, velma
@  velma : (22 April 2013 - 07:51 AM) **yawns** Good to be back, wonder what is going on here :)
@  agyat : (22 April 2013 - 03:50 AM) Oh! so, why don't help me learn english..
@  yordan : (21 April 2013 - 08:38 PM) The goal mentioned by shiu : "learning english, learning computer"
@  agyat : (21 April 2013 - 06:31 PM) WHAT GOAL?
@  yordan : (20 April 2013 - 10:39 AM) yes, that's our goal. simultaneouly learning English and teaching/learning computer using.
@  shiyu : (20 April 2013 - 07:30 AM) learning english,learning computer
@  yordan : (19 April 2013 - 01:11 PM) Oh, I see, it's just a trick in order to force people looking at your texte. Somehow smart, maybe.
@  agyat : (19 April 2013 - 02:54 AM) And of course I know it is not SEO friendly.
@  agyat : (19 April 2013 - 02:52 AM) There may be two possible answers for that ....


1) Shout was posted using mobile keypad.

2) To force people read content carefully and/or with more concentration.
@  agyat : (19 April 2013 - 02:49 AM) There may be two possible answers for that ....
@  yordan : (18 April 2013 - 09:35 PM) however, why this mixing of capital letters in the middle of your text?
@  agyat : (18 April 2013 - 11:10 AM) false feelings.

Photo
- - - - -

VB.NET: How To Create Aqua Buttons


11 replies to this topic

#1 miCRoSCoPiC^eaRthLinG

miCRoSCoPiC^eaRthLinG

    PsYcheDeLiC dR3aMeR

  • [MODERATOR]
  • 2,248 posts
  • Gender:Male
  • Location:Bangkok, Thailand
  • Interests:Photography, Magic Tricks, Numismatics & Philately to some extent, Being a nuisance in general (that's my favourite)
  • myCENTs:NEGATIVE[-21.50]

Posted 04 February 2005 - 01:20 PM

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.

If you are unsure what an Aqua Button is - take a look at the following picture:
Posted Image

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
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.

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:
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"

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.

Towards the top of your code, above the windows forms designer generate region add in a statement:
Friend Withevents Button1 As WildGrape.Aqua.Controls.Button

Inside your Form_Load procedure add the following statements:
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):
Attached File  AquaButton.zip   6.11K   1366 downloads

Download the attachment (Zipped with Windows Zipper):
Attached File  Aqb.zip   6.09K   635 downloads

#2 Ryan

Ryan

    Member - Active Contributor

  • Members
  • 87 posts

Posted 28 February 2005 - 03:52 PM

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?

#3 miCRoSCoPiC^eaRthLinG

miCRoSCoPiC^eaRthLinG

    PsYcheDeLiC dR3aMeR

  • [MODERATOR]
  • 2,248 posts
  • Gender:Male
  • Location:Bangkok, Thailand
  • Interests:Photography, Magic Tricks, Numismatics & Philately to some extent, Being a nuisance in general (that's my favourite)
  • myCENTs:NEGATIVE[-21.50]

Posted 07 March 2005 - 05:42 AM

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

#4 vizskywalker

vizskywalker

    Techno-Necromancer

  • Members
  • 1,018 posts
  • Location:The Net

Posted 07 March 2005 - 07:17 AM

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.

#5 h3lium

h3lium

    Newbie [ Level 2 ]

  • Members
  • 10 posts

Posted 10 August 2005 - 06:56 PM

interesting idea, i had never thought of this. do you have the c# code or a link to it?

#6 miCRoSCoPiC^eaRthLinG

miCRoSCoPiC^eaRthLinG

    PsYcheDeLiC dR3aMeR

  • [MODERATOR]
  • 2,248 posts
  • Gender:Male
  • Location:Bangkok, Thailand
  • Interests:Photography, Magic Tricks, Numismatics & Philately to some extent, Being a nuisance in general (that's my favourite)
  • myCENTs:NEGATIVE[-21.50]

Posted 10 August 2005 - 07:04 PM

interesting idea, i had never thought of this. do you have the c# code or a link to it?

<{POST_SNAPBACK}>


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 ..

#7 willytb

willytb

    Newbie [ Level 1 ]

  • Members
  • 1 posts

Posted 08 February 2006 - 04:14 AM

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


[note=miCRoSCoPiC^eaRthLinG] Please stop quoting a whole post when your feedback is just one line. [/note]

Edited by miCRoSCoPiC^eaRthLinG, 08 February 2006 - 05:42 AM.


#8 miCRoSCoPiC^eaRthLinG

miCRoSCoPiC^eaRthLinG

    PsYcheDeLiC dR3aMeR

  • [MODERATOR]
  • 2,248 posts
  • Gender:Male
  • Location:Bangkok, Thailand
  • Interests:Photography, Magic Tricks, Numismatics & Philately to some extent, Being a nuisance in general (that's my favourite)
  • myCENTs:NEGATIVE[-21.50]

Posted 08 February 2006 - 05:44 AM

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)

#9 warbird

warbird

    Little MechBirdie

  • Members
  • 299 posts
  • Location:Down here in Holland

Posted 08 February 2006 - 10:48 AM

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

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=-

#10 miCRoSCoPiC^eaRthLinG

miCRoSCoPiC^eaRthLinG

    PsYcheDeLiC dR3aMeR

  • [MODERATOR]
  • 2,248 posts
  • Gender:Male
  • Location:Bangkok, Thailand
  • Interests:Photography, Magic Tricks, Numismatics & Philately to some extent, Being a nuisance in general (that's my favourite)
  • myCENTs:NEGATIVE[-21.50]

Posted 08 February 2006 - 11:31 AM

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.

#11 Guest_FeedBacker_*

Guest_FeedBacker_*
  • Guests

Posted 13 February 2008 - 12:35 PM

creating button in vb.net
VB.NET: How To Create Aqua Buttons

How can I create a button (its background ,image etc) in the window form

Kindly give me the responce

-NIRAV

#12 Guest_FeedBacker_*

Guest_FeedBacker_*
  • Guests

Posted 06 March 2008 - 06:55 AM

vb.net animated button creation
VB.NET: How To Create Aqua Buttons

How to create animated button in vb.Net.

-question by guna



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users