Hi,
I'm trying to retain the background color of a button on the click event to indicate it's the last button that was selected. Clicking another button should reset the first button then highlight the second button. All four backcolor assignments work fine, but on the reset side only the first backcolor property seems to work.
Dim theme As Theme = ThemeRepository.FindTheme(Me.myButton.ThemeName)
Dim repository As StyleRepository = theme.FindRepository("ButtonMouseDownFill")
Dim setting As PropertySetting
Dim bColor As Color, bColor2 As Color, bColor3 As Color, bColor4 As Color
setting = repository.FindSetting("BackColor") : bColor = CType(setting.EndValue, Color)
setting = repository.FindSetting("BackColor2") : bColor2 = CType(setting.EndValue, Color)
setting = repository.FindSetting("BackColor3") : bColor3 = CType(setting.EndValue, Color)
setting = repository.FindSetting("BackColor4") : bColor4 = CType(setting.EndValue, Color)
Select Case buttonName
Case Me.btnFirst.Name
Me.btnSecond.ButtonElement.ButtonFillElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local)
Me.btnSecond.ButtonElement.ButtonFillElement.ResetValue(LightVisualElement.BackColor2Property, ValueResetFlags.Local) '<-- doesn't work
Me.btnSecond.ButtonElement.ButtonFillElement.ResetValue(LightVisualElement.BackColor3Property, ValueResetFlags.Local) '<-- doesn't work
Me.btnSecond.ButtonElement.ButtonFillElement.ResetValue(LightVisualElement.BackColor4Property, ValueResetFlags.Local) '<-- doesn't work
Me.btnFirst.ButtonElement.ButtonFillElement.BackColor = bColor
Me.btnFirst.ButtonElement.ButtonFillElement.BackColor2 = bColor2
Me.btnFirst.ButtonElement.ButtonFillElement.BackColor3 = bColor3
Me.btnFirst.ButtonElement.ButtonFillElement.BackColor4 = bColor4
Case Me.btnSecond.Name
Me.btnFirst.ButtonElement.ButtonFillElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local)
Me.btnFirst.ButtonElement.ButtonFillElement.ResetValue(LightVisualElement.BackColor2Property, ValueResetFlags.Local) '<-- doesn't work
Me.btnFirst.ButtonElement.ButtonFillElement.ResetValue(LightVisualElement.BackColor3Property, ValueResetFlags.Local) '<-- doesn't work
Me.btnFirst.ButtonElement.ButtonFillElement.ResetValue(LightVisualElement.BackColor4Property, ValueResetFlags.Local) '<-- doesn't work
Me.btnSecond.ButtonElement.ButtonFillElement.BackColor = bColor
Me.btnSecond.ButtonElement.ButtonFillElement.BackColor2 = bColor2
Me.btnSecond.ButtonElement.ButtonFillElement.BackColor3 = bColor3
Me.btnSecond.ButtonElement.ButtonFillElement.BackColor4 = bColor4
End Select