OptionButton visual cueing

G

Guest

I'm being pernickety but……..

On a form say there are 3 optbtns amongst textboxes and comboboxes.
To enhance the marquee cue when an optbtn has focus I change its forecolour
using:
Private Sub optbtn1_Enter()
optbtn1.ForeColor = vbRed
End Sub

and on exit:
Private Sub optbtn1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
optbtn1.ForeColor = vbBlue
End Sub
etc etc

This is fine when tabbing around the form and then selecting a control using
the spacebar.
However there is a little niggle when it comes to selecting a control which
does not have focus for example:
Say optbtn3 has focus (red) and the user wishes to select optbtn1 with the
mouse. On MouseDown, optbtn1's Enter event is fired and its colour changes
to red until MouseUp, code is executed and focus is moved elsewhere.
This momentary flash of 'highlighting' colour is a bit distracting. Are
there other events I could use to achieve the same visual cueing yet avoid
the flash?

T.I.A.

Geoff
 
P

Peter T

Hi Geoff,

Not sure I follow. If (?) you mean when user selects the option button with
mouse you DON'T want forecolor to change from blue to red, because code in
the mouseup event will go on to select another control, perhaps reset colour
to vbBlue in the Mousedown event. The mousedown event would file so soon
after the Enter event the colour change would not be noticeable.

Regards,
Peter T
 
G

Guest

Hi Peter
Your supposition was correct and your suggestion worked too.

Thank you.

Geoff
 
Top