Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing those bland command buttons 3

Status
Not open for further replies.

anxious

Programmer
Jan 31, 2000
4
0
0
US
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. <br>
<br>
Any help would be much appreciated!
 
Check out <A HREF=" TARGET="_new"> 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. <p>Steve Meier<br><a href=mailto:sdmeier@jcn1.com>sdmeier@jcn1.com</a><br><a href= > </a><br>
 
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.<br>
<br>
You will need (1) an image editor such as Photoshop or Paint Shop Pro and (2) some imagination (grin).<br>
<br>
Determine what you would like for command button images; should you suffer some creative block visit a site such as <A HREF=" TARGET="_new"> for inspiration.<br>
<br>
In the image editor, create your buttons - round ones, flat ones as in MS Money - whatever you prefer. Fashion one button for &quot;normal&quot; and another for when the user has clicked the button, as in a mouseover event.<br>
<br>
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.<br>
<br>
On your VB form create both buttons as images. Name the buttons that which appeals to you; I used as an example &quot;imgCreateTask&quot; for the &quot;normal&quot; button and &quot;imgSelCreateTask&quot; for the clicked button (Sel means &quot;selected&quot;).<br>
<br>
The latter button must be &quot;.visible = false&quot;<br>
<br>
Now the MouseUp and MouseDown procedures are important, &quot;click&quot; is no more.<br>
<br>
Private Sub imgCreateTask_MouseDown(Button as Integer ...)<br>
imgCreateTask.Visible = False<br>
imgSelCreateTask.Visible = True<br>
End Sub<br>
<br>
Private Sub imgCreateTask_MouseUp(Button as Integer ...)<br>
imgCreateTask.Visible = True<br>
imgSelCreateTask.Visible = False<br>
<br>
Select Case Button<br>
Case 1<br>
&lt;put your code here&gt;<br>
Case 2<br>
Beep<br>
&lt;or create a pop up menu for help&gt;<br>
Case 3<br>
Beep<br>
End Select<br>
<br>
End Sub<br>
<br>
Remember to always place your code in the MouseUp so that your button might return to &quot;normal&quot; 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.<br>
<br>
Hope this helps!<br>
<p>Nicholas, BofA NetOps<br><a href=mailto: > </a><br><a href= > </a><br>Biologically Classified as Alpha-Geek 234
 
Nicholas:<br>
<br>
MOST EXCELLENT! It works exactly as you described. Now, my app looks visibly cooler! Thanks a million!
 
Thank you! More than happy to help. <p>Nicholas, BofA NetOps<br><a href=mailto: Nick.deLioncourt@BankofAmerica.com> Nick.deLioncourt@BankofAmerica.com</a><br><a href= > </a><br>Biologically Tagged as Alpha-Geek #234
 
<br>
Additionally, the ie5 buttons have three states:<br>
1. gray (normal)<br>
2. color (when mouse is over the button)<br>
3. depressed color (when clicked)<br>
<br>
With minor modifications to Nicholas' code, you can really have a super cool interface. Just be careful of which image you put code into!!!<br>
<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top