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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Buttons like Microsoft explorer bar 2

Status
Not open for further replies.

Albano

Instructor
Dec 11, 2000
221
PT
someame now if is possible to put command buttons, like the buttons on the explorer or Internet explorar bar.

Thanks,

Albano
 
You can build your own toolbar and place as many buttons as you like. I use custom toolbars for applications built through Access to limit users abilities to perform tasks.
Bryan Meek
bmeek@pacbell.net
A "Solution Provider" in your corner gives you the personal attention you need to find the right technology solutions for your business.
 
If you are talking about the way they change from Flat to Raised when you move over them, then yes, depending on how much work you want to do. Instead of using a Command Button, you need to use an Image Control to store the picture, and a Label Control that will fit over it. Place the Label Control over (and move to Front) the Image Control and set it's SpecialEffect to "Flat", and ensure that it's BackStyle is "Transparent", and add a blank space as it's Caption. Add the code you want to perform to the "Click" Event of the Label Control, just like you would for a Command Button. Then you need to provide code that will change the Label Control's properties. This example uses the MouseMove Event for the each of the Label Controls to do the passing of info to a Function in the Form's Code Module. It also uses the Detail's MouseMove Event to Return the Label Control back to it's original values when the mouse moves off of the Label Control. It requires that you set a Module Level Variable. To use this place in the MouseMove Event for the Label Control (i.e. lblImg1 as it's name) the name of the Function you're calling and pass it the name of the Label Control.

= fSetRaised("lblImg1")

Then for the Detail's MouseMove Event use, notice no need to pass it the name of the Label Control

= fUnsetRaised()

Below is the Code to add to the Form's Code Module:

Dim mstPrevControl As String ' Module Level Variable

Function fSetRaised(stControlName As String)
' ***********************************************************************************
' * Changes a Label Control's Special Effect from Flat to Raised,
' * and it's Border Style from Transparent to Solid
' * when the mouse passes over a Label Control, lets the user know what button
' * will be selected when the mouse is clicked
' * Requires a Modular Variable: Dim mstPrevControl As String
' ***********************************************************************************

On Error Resume Next
With Me(mstPrevControl)
.BorderStyle = 0 ' Transparent
.SpecialEffect = 0 ' Flat
End With
mstPrevControl = stControlName
With Me(stControlName)
.SpecialEffect = 1 'Raised
.BorderStyle = 1 ' Solid
End With
End Function

Function fUnsetRaised()
' ****************************************************************************
' * sets Border Style to Transparent and Special Effect from Raised to Flat
' * for the Label Control changed in Function fSetRaised()
' ****************************************************************************
On Error Resume Next
With Me(mstPrevControl)
.SpecialEffect = 0 ' Flat
.BorderStyle = 0 ' Transparent
End With

End Function

This is a variation of code that I found out on the net that was used to change the Font and Color of the Text in a Control when the mouse passed over the control.

HTH
PaulF
 
This is just what i was loking for.

Tanks PaulF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top