J
JennKriv
I have a timesheet form in which I have the date name and other headings such
as layout and sawing on it. It is a continuous form. What I am looking to do
is that as I am working in the text box I want the label above to highlight
so I know that I am in the correct field.
I found this code but I don't know how to fix it,
My fields i want to change are LBLLayout, which I want to bold when the
cursor is focused on text box Layout.
Any Ideas, is this even a code that would work for me?
Private lblMagic As Label
Private Const conHighlightOff = 500
Private Const conHighlightOn = 600
Private Const conCmdForeColorNotSelected As Long = &H606060
Private Const conCmdForeColorSelected As Long = 12941568
Private Sub MagicLabelOn(lbl As Label)
Dim bDoNothing As Boolean
If Not lblMagic Is Nothing Then
If lbl.Name = lblMagic.Name Then
bDoNothing = True
Else
Call MagicLabelOff
End If
End If
If Not bDoNothing Then
lbl.FontWeight = conHighlightOn
lbl.Parent.ForeColor = conCmdForeColorSelected
Set lblMagic = lbl
End If
End Sub
Private Sub MagicLabelOff()
If Not lblMagic Is Nothing Then
lblMagic.FontWeight = conHighlightOff
lblMagic.Parent.ForeColor = conCmdForeColorNotSelected
Set lblMagic = Nothing
End If
End Sub
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
Call MagicLabelOff
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set lblMagic = Nothing
End Sub
'Example of what goes in the GotFocus and MouseMove of each command button:
Private Sub cmdReport_GotFocus()
Call MagicLabelOn(Me.lblcmdReport)
End Sub
Private Sub cmdReport_MouseMove(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
Call MagicLabelOn(Me.lblcmdReport)
End Sub
as layout and sawing on it. It is a continuous form. What I am looking to do
is that as I am working in the text box I want the label above to highlight
so I know that I am in the correct field.
I found this code but I don't know how to fix it,
My fields i want to change are LBLLayout, which I want to bold when the
cursor is focused on text box Layout.
Any Ideas, is this even a code that would work for me?
Private lblMagic As Label
Private Const conHighlightOff = 500
Private Const conHighlightOn = 600
Private Const conCmdForeColorNotSelected As Long = &H606060
Private Const conCmdForeColorSelected As Long = 12941568
Private Sub MagicLabelOn(lbl As Label)
Dim bDoNothing As Boolean
If Not lblMagic Is Nothing Then
If lbl.Name = lblMagic.Name Then
bDoNothing = True
Else
Call MagicLabelOff
End If
End If
If Not bDoNothing Then
lbl.FontWeight = conHighlightOn
lbl.Parent.ForeColor = conCmdForeColorSelected
Set lblMagic = lbl
End If
End Sub
Private Sub MagicLabelOff()
If Not lblMagic Is Nothing Then
lblMagic.FontWeight = conHighlightOff
lblMagic.Parent.ForeColor = conCmdForeColorNotSelected
Set lblMagic = Nothing
End If
End Sub
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
Call MagicLabelOff
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set lblMagic = Nothing
End Sub
'Example of what goes in the GotFocus and MouseMove of each command button:
Private Sub cmdReport_GotFocus()
Call MagicLabelOn(Me.lblcmdReport)
End Sub
Private Sub cmdReport_MouseMove(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
Call MagicLabelOn(Me.lblcmdReport)
End Sub