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!

Create rollovers on forms? 1

Status
Not open for further replies.

TimSlape

Technical User
Jun 1, 2001
18
0
0
US
My attempts to use Flash and gifs in Access went nowhere. Anyone have a simple method for making command buttons act like rollovers, i.e. change color on mouse over? If this was UltraDev, I'd be cooking.

Thanks so much

Tim Slape
 
Tim -

You can put an event in the MouseOver section for a button, but you can't change its colour (I don't know why, but Microcoft don't provide a property for that. You can change the colour of the text, though.

A better effect can be created by making the button invisible and putting the caption on a label placed behind it. That way the user appears to be clicking on a word, though they're actually clicking your invisible button. (If you want a picture to click on instead, then use an unbound image box instead of a label).

Using this method, you can change the Special Effect on the label, say from Flat to Sunken. It looks quite good. In order that it doesn't stay that way you'll need another procedure attached to the MouseOver event of the Detail section, resetting all such buttons to Flat (or whatever they were before). Of course, the Special Effect isn't the only thing you can change - you can change colour, font, caption, whatever you like.

Hope that helps.

Best regards

Paul
 
Using a label on a form, when you click on it, it will increase in font size, change color, perform an event you determine an .25 seconds later, change back to normal/
The delay in seconds is given by the Pause function.
Hope it works
RGB

NameOfLabel is the name of any label on the current form
Multiple labels can be used by giving each a unique name

Private Sub Region00RadioButton_Click()
Set FieldToBlinkName = Me.NameOfLabel
Call ChangeToBoldRedThenBack
End Sub


Public Function ChangeToBoldRedThenBack()
FieldToBlinkName.FontSize = 8
FieldToBlinkName.ForeColor = 255
Pause (0.25)
FieldToBlinkName.FontSize = 7
FieldToBlinkName.ForeColor = 0
End Function


Public Function Pause(DelayInSeconds As Double) As Double
Dim PauseTime, Start, Finish, TotalTime
PauseTime = DelayInSeconds ' Sets length of Pause.
Start = Timer ' Starts the delay.
Do While Timer < Start + PauseTime
DoEvents ' Let other stuff run while paused.
Loop
End Function
 
Just a quick followup - for more clarity

change - Private Sub Region00RadioButton_Click()
to read Private Sub NameOfLabel_Click()

Sorry I missed it before
RGB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top