KP_SoCal
Registered User.
- Local time
- Today, 15:35
- Joined
- Dec 4, 2009
- Messages
- 39
Change font color on ALL form controls on "Got Focus" and "Lost Focus"
On my form I have numberous command button controls. As you can see from my code below, I'm applying one style of font and color when the control has focus and I'm applying another style when it loses focus.
To accomplish this, I'm re-writing this for each control. I know I could write another routine for focus and lost focus and call it for each control, but would it be possible to write one block of code that would apply a particular font style to ALL command button controls in my form?
Thanks!
On my form I have numberous command button controls. As you can see from my code below, I'm applying one style of font and color when the control has focus and I'm applying another style when it loses focus.
To accomplish this, I'm re-writing this for each control. I know I could write another routine for focus and lost focus and call it for each control, but would it be possible to write one block of code that would apply a particular font style to ALL command button controls in my form?
Thanks!
Code:
Private Sub cmdEmail_GotFocus()
With cmdTransferCheck
.ForeColor = RGB(0, 0, 255)
.FontBold = True
End With
End Sub
Private Sub cmdEmail_LostFocus()
With cmdTransferCheck
.ForeColor = vbBlack
.FontBold = False
End With
End Sub