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

In my Userform, I have the following code making lables visible when
mouseover textbox. However, you have to go back to the label to hide it. So
if your mouse even comes close to one of the other textboxes it will also be
visible. Two labels can be visible at the same time. This doesnt work well
with a two column frame.

Can this be changed instead to make label visible when you click on the
textbox and when you click again the label will be invisible? Can this be
done? How would the code change?? Thank you.



Private Sub UserForm_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Label280.Visible = True
Me.Label280.Visible = False
Me.Label282.Visible = True
Me.Label282.Visible = False
Me.Label283.Visible = True
Me.Label283.Visible = False
Me.Label284.Visible = True
Me.Label284.Visible = False
Me.Label285.Visible = True
Me.Label285.Visible = False


Private Sub CheckBox470_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Label280.Visible = True

End Sub

Private Sub CheckBox465_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Label282.Visible = True

End Sub
Private Sub CheckBox467_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Label283.Visible = True

End Sub
Private Sub CheckBox466_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Label284.Visible = True

End Sub
Private Sub CheckBox468_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Label285.Visible = True

End Sub

Private Sub Label280_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Label280.Visible = False

End Sub
Private Sub Label282_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Label282.Visible = False

End Sub
Private Sub Label283_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Label283.Visible = False

End Sub
Private Sub Label284_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Label284.Visible = False

End Sub
Private Sub Label285_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Label285.Visible = False

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Userform Question


Hope I'm on the same wave length as your posting...

I think I am correct by assuming you know the events (and event model) for the
UserForm. One way may be to declare a state Boolean variable that, toggles
between true and false depending on the last state is was in, from the last click.
Something like (but not precisely);

Private mblnIsVisible As Boolean 'Yes declare it at module level
....

Private Sub UIObject_Click()

Me.UIObject.Visible = mblnIsVisible

mblnIsVisible = Not mblnIsVisible
End Sub

- Or -

Maybe you don't need the Module variable;

Private Sub UIObject_Click()

Me.UIObject.Visible = Not Me.UIObject.Visible
End Sub

But you will need the UIObject defined in an initial Visible state. Oh and
Me.UIObject is a user control of some sort, TextBox, Label, CheckBox, Button,
......

I hope this assists you somewhat, and the first event Sub below you've
implemented, what is it supposed to do? If you have a really slow (I mean a really
really slow processor), it may look cool to flash your labels, but I'm sure that's
not your intension, nor would you have a slow processor in today's modern world.


--

Thanks and regards,

Offace

"TotallyConfused" wrote in message
...
| In my Userform, I have the following code making lables visible when
| mouseover textbox. However, you have to go back to the label to hide it. So
| if your mouse even comes close to one of the other textboxes it will also be
| visible. Two labels can be visible at the same time. This doesn't work well
| with a two column frame.
|
| Can this be changed instead to make label visible when you click on the
| textbox and when you click again the label will be invisible? Can this be
| done? How would the code change?? Thank you.
|
|
|
| Private Sub UserForm_MouseMove(ByVal Button As Integer, _
| ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
| Me.Label280.Visible = True
| Me.Label280.Visible = False
| Me.Label282.Visible = True
| Me.Label282.Visible = False
| Me.Label283.Visible = True
| Me.Label283.Visible = False
| Me.Label284.Visible = True
| Me.Label284.Visible = False
| Me.Label285.Visible = True
| Me.Label285.Visible = False
|
|
| Private Sub CheckBox470_MouseMove(ByVal Button As Integer, _
| ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
| Me.Label280.Visible = True
|
| End Sub
|
| Private Sub CheckBox465_MouseMove(ByVal Button As Integer, _
| ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
| Me.Label282.Visible = True
|
| End Sub
| Private Sub CheckBox467_MouseMove(ByVal Button As Integer, _
| ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
| Me.Label283.Visible = True
|
| End Sub
| Private Sub CheckBox466_MouseMove(ByVal Button As Integer, _
| ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
| Me.Label284.Visible = True
|
| End Sub
| Private Sub CheckBox468_MouseMove(ByVal Button As Integer, _
| ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
| Me.Label285.Visible = True
|
| End Sub
|
| Private Sub Label280_MouseMove(ByVal Button As Integer, _
| ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
| Me.Label280.Visible = False
|
| End Sub
| Private Sub Label282_MouseMove(ByVal Button As Integer, _
| ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
| Me.Label282.Visible = False
|
| End Sub
| Private Sub Label283_MouseMove(ByVal Button As Integer, _
| ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
| Me.Label283.Visible = False
|
| End Sub
| Private Sub Label284_MouseMove(ByVal Button As Integer, _
| ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
| Me.Label284.Visible = False
|
| End Sub
| Private Sub Label285_MouseMove(ByVal Button As Integer, _
| ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
| Me.Label285.Visible = False
|
| End Sub
|


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
Userform question ub Excel Discussion (Misc queries) 0 February 19th 09 06:56 PM
UserForm question Matt[_48_] Excel Programming 2 June 23rd 07 06:50 AM
UserForm Question Need Help! jfcby[_2_] Excel Programming 2 October 14th 06 03:20 AM
VBA UserForm Question.......Help! Sam Torasco Excel Programming 6 July 19th 04 01:23 PM
Userform question Oreg[_8_] Excel Programming 1 May 27th 04 02:46 AM


All times are GMT +1. The time now is 02:52 AM.

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"