Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Changing those bland command buttons

Changing those bland command buttons

Changing those bland command buttons

Does anyone know how I can spice up the look of my program by using something other than those bland rectangular gray command buttons...I'd like to use buttons that you see on web pages.

Any help would be much appreciated!

RE: Changing those bland command buttons

Check out www.vbxtras.com, they have this kind of thing. I've seen them there before. Use the search engine on their page to find what you're looking for.

Steve Meier

RE: Changing those bland command buttons

I have done just that in my application. When I began, I could find no references to this process yet I knew it could be done, so I became a bit creative.

You will need (1) an image editor such as Photoshop or Paint Shop Pro and (2) some imagination (grin).

Determine what you would like for command button images; should you suffer some creative block visit a site such as www.skinz.org for inspiration.

In the image editor, create your buttons - round ones, flat ones as in MS Money - whatever you prefer. Fashion one button for "normal" and another for when the user has clicked the button, as in a mouseover event.

If your buttons are composed of large blocks of single colours, save the image as GIF. If yours is more like a photograph then use JPEGs.

On your VB form create both buttons as images. Name the buttons that which appeals to you; I used as an example "imgCreateTask" for the "normal" button and "imgSelCreateTask" for the clicked button (Sel means "selected").

The latter button must be ".visible = false"

Now the MouseUp and MouseDown procedures are important, "click" is no more.

Private Sub imgCreateTask_MouseDown(Button as Integer ...)
imgCreateTask.Visible = False
imgSelCreateTask.Visible = True
End Sub

Private Sub imgCreateTask_MouseUp(Button as Integer ...)
imgCreateTask.Visible = True
imgSelCreateTask.Visible = False

Select Case Button
Case 1
<put your code here>
Case 2
<or create a pop up menu for help>
Case 3
End Select

End Sub

Remember to always place your code in the MouseUp so that your button might return to "normal" and use the Select Case Button so that the right mouse button cannot initiate the same routines as the left; otherwise, you might confuse the users.

Hope this helps!

Nicholas, BofA NetOps

Biologically Classified as Alpha-Geek 234

RE: Changing those bland command buttons

Excellent post Nicholas!

RE: Changing those bland command buttons


MOST EXCELLENT! It works exactly as you described. Now, my app looks visibly cooler! Thanks a million!

RE: Changing those bland command buttons

Thank you! More than happy to help.

Nicholas, BofA NetOps

Biologically Tagged as Alpha-Geek #234

RE: Changing those bland command buttons

Additionally, the ie5 buttons have three states:
1. gray (normal)
2. color (when mouse is over the button)
3. depressed color (when clicked)

With minor modifications to Nicholas' code, you can really have a super cool interface. Just be careful of which image you put code into!!!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close