K
Kirstie Adam
Hi All,
I have a switchboard which is beginning to get a bit ugly with buttons and
labels everywhere, so i am re-organising it.
For each of my labels (currently font blue and underlined to look like a
hyperlink) on the MouseDown event i want the text color to change to Red and
the FontUnderline to switch off, and then on MouseUp i want the text colour
to change again and the underline back on.
I have got this working, however am having to type the same code in over and
over for each individual label. is there a way i can save the code in a
module or something and then attach it to each label i want to do this?
I have never worked with modules before, so if this is the case, please
could you explain from the basics?!
Just so you know, the code i have at the moment, against each label is:
Private Sub lblSiteInfo_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Me.lblSiteInfo.ForeColor = vbRed
Me.lblSiteInfo.FontUnderline = False
End Sub
Private Sub lblSiteInfo_MouseUp(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Me.lblSiteInfo.ForeColor = 10040115
Me.lblSiteInfo.FontUnderline = True
End Sub
And if that's not enough, i'd quite like the background of a label to change
as the mouse moves over it and back again when the mouse moves off it, even
if not clicked, is this possible??
Any suggestions much appreciated!
Kirstie
I have a switchboard which is beginning to get a bit ugly with buttons and
labels everywhere, so i am re-organising it.
For each of my labels (currently font blue and underlined to look like a
hyperlink) on the MouseDown event i want the text color to change to Red and
the FontUnderline to switch off, and then on MouseUp i want the text colour
to change again and the underline back on.
I have got this working, however am having to type the same code in over and
over for each individual label. is there a way i can save the code in a
module or something and then attach it to each label i want to do this?
I have never worked with modules before, so if this is the case, please
could you explain from the basics?!
Just so you know, the code i have at the moment, against each label is:
Private Sub lblSiteInfo_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Me.lblSiteInfo.ForeColor = vbRed
Me.lblSiteInfo.FontUnderline = False
End Sub
Private Sub lblSiteInfo_MouseUp(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Me.lblSiteInfo.ForeColor = 10040115
Me.lblSiteInfo.FontUnderline = True
End Sub
And if that's not enough, i'd quite like the background of a label to change
as the mouse moves over it and back again when the mouse moves off it, even
if not clicked, is this possible??
Any suggestions much appreciated!
Kirstie