Is there an easy way to change all of a control's format properties (1 Viewer)

PhoenixofMT

Part-time Access Guru
Local time
Today, 09:36
Joined
Jul 23, 2008
Messages
35
I have a button on my form that I want to change color depending on some other value on the form. With the plethora of properties involved in doing this, is there something like the format painter that I can use in VBA? My plan was to copy the properties from other butons:
Code:
  With Me.cmdCalibrate
    Select Case Mode
      Case 1
        .BackColor = Me.cmdUpdateCal.BackColor
        .BorderShade = Me.cmdUpdateCal.BorderShade
        .BorderStyle = Me.cmdUpdateCal.BorderStyle
        .BorderThemeColorIndex = Me.cmdUpdateCal.BorderThemeColorIndex
        .BorderTint = Me.cmdUpdateCal.BorderTint
        .BorderWidth = Me.cmdUpdateCal.BorderWidth
        .HoverColor = Me.cmdUpdateCal.HoverColor
        .HoverForeColor = Me.cmdUpdateCal.HoverForeColor
        .HoverForeShade = Me.cmdUpdateCal.HoverForeShade
        .HoverForeThemeColorIndex = Me.cmdUpdateCal.HoverForeThemeColorIndex
        .HoverForeTint = Me.cmdUpdateCal.HoverForeTint
        .HoverShade = Me.cmdUpdateCal.HoverShade
        .HoverThemeColorIndex = Me.cmdUpdateCal.HoverThemeColorIndex
        .HoverTint = Me.cmdUpdateCal.HoverTint
...
but this is taking forever and I'm running the risk of missing a property (I found stuff with IntelliSense I don't see in the properties window).
I'm thinking I may just have to stack two buttons with different formatting, show/hide them, and have them call the same code.
Any advice?
 

Users who are viewing this thread

Top Bottom