Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a UserForm wich contains 20 Labels that should react to the Click event. All those Labels have the special effect "Raised". When the user clicks on one of them, it sinks like a button "Sunken". This works fine but what I want is that when the user clicks on another Label, the previous one returns to its original state (Raised) while the actuel Label sinks "Sunken". First I wrote some code for each of the Labels to obtain the desired effect: In the UserForm module: Public MyObject As Control Private Sub LabelA1_Click() 'For each Label (20 times) Set MyObject = LabelA1 Call SinkLabel End Sub Then a procedure to go from "Raised" to "Sunken": Public Sub SinkLabel() Static PrevObject As Control If MyObject.SpecialEffect = fmSpecialEffectSunken Then Exit Sub MyObject.SpecialEffect = fmSpecialEffectSunken If PrevObject Is Nothing Then 'Do nothing Else PrevObject.SpecialEffect = fmSpecialEffectRaised End If Set PrevObject = MyObject End Sub Now I want to use a class module to acheive the same goal, But it works only for the Label on wich the users clicks. It looks like it's impossible to get the previous Label regain the "Raised" state. If someone has an idea... Thank you very much. Pierre |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
CLASS MODULE & SIMPLE MODULE | Excel Discussion (Misc queries) | |||
How to access group buttons in Class Module? | Excel Programming | |||
Reference Class Module in Access from Excel | Excel Programming | |||
Class module in VBA | Excel Programming | |||
Variable from a sheet module in a class module in XL XP | Excel Programming |