O
owp^3
I have several forms with many bound controls...
I want the bound control with focus to have a background color different
from the default and the label to be bold.
I want any bound control with a value that has been changed but not saved to
be bold.
Now I can do this for each control with code like this...
Private Sub ThisControl_GotFocus()
Me.ThisControl.BackColor = 13434828
Me.ThisControl.FontBold = True
End Sub
Private Sub ThisControl_LostFocus()
Me.ThisControl.BackColor = vbWhite
Me.ThisControl.FontBold = False
End Sub
Private Sub ThisControl_AfterUpdate()
Me.ThisControl.FontBold = True
End Sub
I'm not sure I want to take the time to do this for each and every control
on each and every form. I know I can create a common subroutine in module
and pass it parameters. But replacing one or two lines of code with a single
line calling a module doesn't seem like much of a savings.
Is there any way to have a global treatment of control properties and
control events so I am not rewriting the same code over and over again?
I want the bound control with focus to have a background color different
from the default and the label to be bold.
I want any bound control with a value that has been changed but not saved to
be bold.
Now I can do this for each control with code like this...
Private Sub ThisControl_GotFocus()
Me.ThisControl.BackColor = 13434828
Me.ThisControl.FontBold = True
End Sub
Private Sub ThisControl_LostFocus()
Me.ThisControl.BackColor = vbWhite
Me.ThisControl.FontBold = False
End Sub
Private Sub ThisControl_AfterUpdate()
Me.ThisControl.FontBold = True
End Sub
I'm not sure I want to take the time to do this for each and every control
on each and every form. I know I can create a common subroutine in module
and pass it parameters. But replacing one or two lines of code with a single
line calling a module doesn't seem like much of a savings.
Is there any way to have a global treatment of control properties and
control events so I am not rewriting the same code over and over again?