Form Buttons

S

Steve

I am using Access 2000 I would like to know if it is possible to copy the
effect of the mouse over a button that happens when the mouse pointer hovers
over the closing “X†in the control box. Eg when the mouse pointer hovers
over a button but before it is clicked the button changed colour, when the
mouse pointer moves way from the button it changes back to it original colour.
Is it possible to do this in Access 2000?
 
L

Linq Adams via AccessMonster.com

I'm not sure what you're referring to with

"when the mouse pointer hovers over the closing “X†in the control box"

The only thing that happens in my ACC200 is that the tooltip displays "Close,
" but

"when the mouse pointer hovers over a button but before it is clicked the
button changed colour, when the mouse pointer moves way from the button it
changes back to it original colour."

can certainly be done Here's a tutorial from TheScripts showing how to do it.
The example shows the color changes for labels, but the same can be done for
the fore colors of command buttons.

http://www.thescripts.com/forum/thread648549.html

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
S

Steve

Ok on this web page when the mouse pointer goes over the buttons the text on
the button changes colour Tool bare [New, Reply, show] on other buttons the
back ground changes this is to let the user know that this is the button that
will be activated if the mouse is now clicked.
I hope that this makes easer to understand what I am looking for.
 
L

Linq Adams via AccessMonster.com

Ok on this web page when the mouse pointer goes over the buttons the text on
the button changes colour Tool bare [New, Reply, show] on other buttons the
back ground changes this is to let the user know that this is the button that
will be activated if the mouse is now clicked.
I hope that this makes easer to understand what I am looking for.

If you were referring to behavior on some website you'd visited, you should
have said so! Your post insinuated you were talking about Access! The link I
gave you explains how to do what you want to do. The code there was actually
developed to emulate the behavior of of web pages when "rolling over"
labels/buttons. If you want to change the background color of buttons, to
mimic web pages, you need to replace your buttons with labels, then use the
OnClick property of the labels (labels DO have OnClick properties) to carry
out the code previouslyassigned to the command buttons.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
M

Marshall Barton

Steve said:
I am using Access 2000 I would like to know if it is possible to copy the
effect of the mouse over a button that happens when the mouse pointer hovers
over the closing “X” in the control box. Eg when the mouse pointer hovers
over a button but before it is clicked the button changed colour, when the
mouse pointer moves way from the button it changes back to it original colour.
Is it possible to do this in Access 2000?


It's sort of possible. There is no MouseOver event and
command buttons don't have a BackColor, but you can simulate
something using the ForeColor property and the MouseMove
event.

Here's some code in a form's module as a simple example:

Private strPrevCtl As String

Private Function Hovering(strCtl As String)
If strPrevCtl <> strCtl Then
If strPrevCtl <> "" Then
Me(strPrevCtl).ForeColor = vbBlack
End If
Me(strCtl).ForeColor = vbBlue
strPrevCtl = strCtl
End If
End Function

Private Function Unhover()
If strPrevCtl <> "" Then
Me(strPrevCtl).ForeColor = vbBlack
strPrevCtl = ""
End If
End Function

You can then set a control's MouseMove event **property** to
=Hovering("name of the control")
and the detail section's to:
=Unhover()

Note that some controls (e.g. check box, line, etc) don't
even have the ForeColor property so you can not do this on
them. However you could use different functions to get
different effects on different controls (e.g. use button
control's Picture property).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top