I'm having trouble understanding how to get actions done when a toggle button is unclicked. In my user form, the toggle button's purpose is to enable or unenable a text box. In addition to enabling, I'm also toggling the text box's back color and the forecolor of the text box label. I have been successful enabling and unenabling the text box with this code:
MyTextBox.Enabled = MyToggle.Value
For the forecolor and backcolor, I'm trying this and it's not doing any action when I unclick:
With MyToggle.Value = True
MyTextBox.BackColor = ColorConstants.vbWhite
MyLabel.ForeColor = ColorConstants.vbBlack
End With
With MyToggle.Value = True
MyTextBox.BackColor = 15
MyLabel.ForeColor = 15
End With
Basically, I'm trying to get the code for MyToggle.Value = False
Thank you.
MyTextBox.Enabled = MyToggle.Value
For the forecolor and backcolor, I'm trying this and it's not doing any action when I unclick:
With MyToggle.Value = True
MyTextBox.BackColor = ColorConstants.vbWhite
MyLabel.ForeColor = ColorConstants.vbBlack
End With
With MyToggle.Value = True
MyTextBox.BackColor = 15
MyLabel.ForeColor = 15
End With
Basically, I'm trying to get the code for MyToggle.Value = False
Thank you.