Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default label effect

Hi,
A question from a friend of mine. Hope you understand this, cause it's in
dutch. I've tried to translate it at the bottom.

Ik heb een formulier in Vba met een label. Als ik er een commandbutton
bijzet met de code

"Private Sub CommandButton1_Click()
Label1.SpecialEffect = fmSpecialEffectRaised
End Sub"

bij dan krijgt mijn label nen "boebel" als ik op de nop klik. De bedoeling
is echter dat dit gebeurt als ik met de muis over het label ga.

Enig idee iemand?

Translation:
I have a form in vba wich contains a label. When i put a commandbutton in
with the code

"Private Sub CommandButton1_Click()
Label1.SpecialEffect = fmSpecialEffectRaised
End Sub"

then the label gets a bump everytime i press the button. However this should
only happen when i put the cursor on top of the label.

Any ideas anyone?

regards,
Peter


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default label effect

Hi Peter

CommandButton1_Click is the "when I click this button" event. Mousecursor
over is the MouseMove event:

Private Sub Label1_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
Label1.SpecialEffect = fmSpecialEffectRaised
End Sub

Note that there is no MouseOut event, so you must find another event to
detect when the mouse is no longer over it.

HTH. Best wishes Harald

"Peter" skrev i melding
...
Hi,
A question from a friend of mine. Hope you understand this, cause it's in
dutch. I've tried to translate it at the bottom.

Ik heb een formulier in Vba met een label. Als ik er een commandbutton
bijzet met de code

"Private Sub CommandButton1_Click()
Label1.SpecialEffect = fmSpecialEffectRaised
End Sub"

bij dan krijgt mijn label nen "boebel" als ik op de nop klik. De bedoeling
is echter dat dit gebeurt als ik met de muis over het label ga.

Enig idee iemand?

Translation:
I have a form in vba wich contains a label. When i put a commandbutton in
with the code

"Private Sub CommandButton1_Click()
Label1.SpecialEffect = fmSpecialEffectRaised
End Sub"

then the label gets a bump everytime i press the button. However this

should
only happen when i put the cursor on top of the label.

Any ideas anyone?

regards,
Peter




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default label effect

But you move the cursor to the commandbutton1 to click it. So it would no
longer be over the label.

Are you looking for a mousemove event?

The problem there is that you would need to put the label on top of another
control to use the mouseover for that control to return the label to its
former configuration.

Private Sub Label1_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
Label1.SpecialEffect = fmSpecialEffectRaised
End Sub



Private Sub TextBox1_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
Label1.SpecialEffect = fmSpecialEffectFlat
End Sub


Label1 is above, centered and inside the boundaries of Textbox1.

Textbox1 is visible, has specialeffect set to flat, no boarders, background
color matches the userform so it is not noticeable. Tabstop set to false.

Play with it. Worked for me.

--
Regards,
Tom Ogilvy




"Peter" wrote in message
...
Hi,
A question from a friend of mine. Hope you understand this, cause it's in
dutch. I've tried to translate it at the bottom.

Ik heb een formulier in Vba met een label. Als ik er een commandbutton
bijzet met de code

"Private Sub CommandButton1_Click()
Label1.SpecialEffect = fmSpecialEffectRaised
End Sub"

bij dan krijgt mijn label nen "boebel" als ik op de nop klik. De bedoeling
is echter dat dit gebeurt als ik met de muis over het label ga.

Enig idee iemand?

Translation:
I have a form in vba wich contains a label. When i put a commandbutton in
with the code

"Private Sub CommandButton1_Click()
Label1.SpecialEffect = fmSpecialEffectRaised
End Sub"

then the label gets a bump everytime i press the button. However this

should
only happen when i put the cursor on top of the label.

Any ideas anyone?

regards,
Peter




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the font for part of an axis label, not the whole label. amy45 Charts and Charting in Excel 2 April 5th 23 01:11 PM
How to rezize data label box in pie charts (label wraps to two lin rolliedogg Charts and Charting in Excel 1 October 18th 06 08:17 PM
COPY LABEL FORM FROM EXCEL TO A LABEL xrayAndi New Users to Excel 1 March 5th 06 02:21 PM
how to remove label formatting (eg label to number) sikkiekaka Excel Worksheet Functions 0 November 4th 04 11:35 PM
add text to label (label from forms toolbar) Rob Bovey Excel Programming 0 September 5th 03 09:46 PM


All times are GMT +1. The time now is 02:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"