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
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.