Command buttons

S

sandrao

How can have the Command buttons change effects on mouse move. I can get them
to be flat and on mouse move become "Raised" format but then dont return to
flat after mouse leave button?
 
M

missinglinq via AccessMonster.com

Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single,
Y As Single)
'Place code here for what you want to happen when mouse moves off of button

End Sub
 
S

sandrao

Thanks for your response. I did go to the site and copy the code, however it
did not work. I kept getting a error message saying 'wrong use of "Me" also
the code is for changing fonts. What I wish to achieve is to have the
"specialeffects" change on mouse move. Similiar to what you would see on
Microsoft Outlook. When your mouse moves onto the "in Box' it moves from
flat to raised.

Do you have any other suggestions.
 
M

missinglinq via AccessMonster.com

" I can get themto be flat and on mouse move become "Raised" format but then
dont return to
flat after mouse leave button?"

Post the code that you use to do the above things.
 
M

missinglinq via AccessMonster.com

Luan. If you read his original post, what he's trying to do has nothing to do
with making text bold!

Right click on form/Detail:
choose On mouse event: = fremovefontbold()
Luan.
Thanks for your response. I did go to the site and copy the code, however it
did not work. I kept getting a error message saying 'wrong use of "Me" also
[quoted text clipped - 25 lines]
 
L

luanhoxung

ok, my suggestion is changing commandbutton to label or textbox
then OnClick Event make some code as commandbutton do.
Because a command always is raised status.
Luan.
Luan. If you read his original post, what he's trying to do has nothing to do
with making text bold!

Right click on form/Detail:
choose On mouse event: = fremovefontbold()
Luan.
Thanks for your response. I did go to the site and copy the code, however it
did not work. I kept getting a error message saying 'wrong use of "Me" also
[quoted text clipped - 25 lines]
Message posted viahttp://www.accessmonster.com-Hide quoted text -- Show quoted text ---
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200701/1
 
S

sandrao

Well something is not working.

Here is the code I placed in the mousemove event of the 'label' in question:
Me.label.SpecialEffect = 1
Then placed this code in the 'Detail' mousemove event
Me.label1.SpecialEffect = 5

It should work. But it doesn't always return to 'flat'. is there some way
to force the event to comply after the mouse is off of the label.

Sandrao





ok, my suggestion is changing commandbutton to label or textbox
then OnClick Event make some code as commandbutton do.
Because a command always is raised status.
Luan.
Luan. If you read his original post, what he's trying to do has nothing to do
with making text bold!

Right click on form/Detail:
choose On mouse event: = fremovefontbold()
Luan.
Thanks for your response. I did go to the site and copy the code, however it
did not work. I kept getting a error message saying 'wrong use of "Me" also
[quoted text clipped - 25 lines]
Message posted viahttp://www.accessmonster.com-Hide quoted text -- Show quoted text ---
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200701/1
 
R

Rick Brandt

sandrao said:
Well something is not working.

Here is the code I placed in the mousemove event of the 'label' in question:
Me.label.SpecialEffect = 1
Then placed this code in the 'Detail' mousemove event
Me.label1.SpecialEffect = 5

It should work. But it doesn't always return to 'flat'. is there some way
to force the event to comply after the mouse is off of the label.

I have never found using MouseMove for stuff like that to be reliable. If the
mouse is moved too quickly it simply doesn't work.
 
R

Rick Brandt

sandrao said:
If mousemove is not that reliable what else can be done to create the effect
I want

I have no idea why you want to change the special effect of a command button in
the first place. A button is raised when you are not pressing it and depressed
when you are. What is wrong with leaving this perfectly logical behavior
exactly as it is?
 
R

Rick Brandt

sandrao said:
It is not a command button that is being used it is a label....

I guess I was thrown off by the subject "Command Buttons". I would worry less
about achieving a certain "effect" and just use command buttons. Access does
not have the proper MouseOver and MouseOff events for such things like some
other environments do.
 
R

Rodger

OK it has been a while since I have done this . . . . I actually used it to
change the color of the text on my command buttons. I modified it for what
you are looking for. I tried it and it works great . . . . . here it is

I created a new module and placed this function in it . . . .
'******************************************************
Function buttonForeColor(formName As String, btnName As String)

Dim C As Control, colorOn As Integer, colorOff As Integer

For Each C In Forms(formName)

colorOn = 128
colorOff = 13056

If TypeOf C Is Label Then
If C.Caption = "" Then 'Only look at buttons with text
GoTo myEnd
Else
If C.Name = btnName Then
With C
.ForeColor = colorOn
.SpecialEffect = 1
End With
Else
With C
.ForeColor = colorOff
.SpecialEffect = 0
End With
End If
End If
myEnd:
End If
Next C

End Function
'********************************************************

Then on the form on the labels On Mouse Move I put this code on the Event
Prodedure . . .

'********************************************************
Private Sub lblTest_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Call buttonForeColor("frm_main", "lblTest")
End Sub
'********************************************************


HTH,
Rodger
 

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