I'm trying to make a menu.
Every menu item consists of 3 objects: picture, box and label.
The MouseDown Event of all 3 of these objects has the same code:
(And something similar for the MouseUp Event)
'Change background and border colors
Me.boxNewRecord.BackColor = 7921662
Me.boxNewRecord.BorderColor = 0
'Change picture
Me.imgNewRecordYellow.Visible = True
Me.imgNewRecordBlue.Visible = False
'Label background is transparent so no code needed
..........
So I end up with repeating code for these objects.
Should I move it to a module so I can avoid the repetition,
and if so, how do I call it from my form?
All help will be greatly appreciated.
Catalina
Every menu item consists of 3 objects: picture, box and label.
The MouseDown Event of all 3 of these objects has the same code:
(And something similar for the MouseUp Event)
'Change background and border colors
Me.boxNewRecord.BackColor = 7921662
Me.boxNewRecord.BorderColor = 0
'Change picture
Me.imgNewRecordYellow.Visible = True
Me.imgNewRecordBlue.Visible = False
'Label background is transparent so no code needed
..........
So I end up with repeating code for these objects.
Should I move it to a module so I can avoid the repetition,
and if so, how do I call it from my form?
All help will be greatly appreciated.
Catalina