OptionButton visual cueing

G

Geoff

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

Geoff

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

Thank you.

Geoff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Label Formatting Code - Repetitive 1
Flash and fade a notification 3
New books 10

Top