J
JBNewsGroup
Hi
I have a question regarding Class Modules.
In my UserForm I created a collection of labels as:
Private colShapeControls AS Collection
.....
.....
Set ShapeLabel = fraShapes.Add("Forms.Label.1", "lbl" & ShapeName)
With ShapeLabel
.Left = ShapeLeft
.Top = ShapeTop
.Height = 20
.Width = 20
.Caption = ""
.Picture = LoadPicture(ShapePath & ShapeName & ".bmp")
.PicturePosition = fmPicturePositionRightCenter
.Tag = "lbl" & ShapeName
End With
Set cShapeSelect = New clsShapeSelect
Set cShapeSelect.mShapeSelectNew = ShapeLabel
colShapeControls.Add cShapeSelect, Cstr(ShapeId)
.....
.....
The Class Module code is:
Option Explicit
Public WithEvents mShapeSelectNew As MSForms.Label
Private Sub mShapeSelectNew_Click()
With mShapeSelectNew
.BackColor = vbYellow
.SpecialEffect = fmSpecialEffectSunken
End With
End Sub
I need help, or a suggestion, of how to determine the previous label
selected. I am trying to make the labels in the collection mutually
exclusive. If the user selected a label, then selected a different one, I
want to set the previously selected label to its initial state (vbButtonFace
and fmSpecialEffectFlat).
Thanks in advance for any help, and/or suggestions.
Jerry Bodoff
I have a question regarding Class Modules.
In my UserForm I created a collection of labels as:
Private colShapeControls AS Collection
.....
.....
Set ShapeLabel = fraShapes.Add("Forms.Label.1", "lbl" & ShapeName)
With ShapeLabel
.Left = ShapeLeft
.Top = ShapeTop
.Height = 20
.Width = 20
.Caption = ""
.Picture = LoadPicture(ShapePath & ShapeName & ".bmp")
.PicturePosition = fmPicturePositionRightCenter
.Tag = "lbl" & ShapeName
End With
Set cShapeSelect = New clsShapeSelect
Set cShapeSelect.mShapeSelectNew = ShapeLabel
colShapeControls.Add cShapeSelect, Cstr(ShapeId)
.....
.....
The Class Module code is:
Option Explicit
Public WithEvents mShapeSelectNew As MSForms.Label
Private Sub mShapeSelectNew_Click()
With mShapeSelectNew
.BackColor = vbYellow
.SpecialEffect = fmSpecialEffectSunken
End With
End Sub
I need help, or a suggestion, of how to determine the previous label
selected. I am trying to make the labels in the collection mutually
exclusive. If the user selected a label, then selected a different one, I
want to set the previously selected label to its initial state (vbButtonFace
and fmSpecialEffectFlat).
Thanks in advance for any help, and/or suggestions.
Jerry Bodoff