tonedefiant
Programmer
I'm new to this, any tips are appreciated.
I set my toggle's triplestate=TRUE and the FALSE state sets focus to a text field, yeah!
Now, I want what I type in the text field to appear as the new caption of the toggle I just came from. Any ideas? This same text field will need to be reused for many more toggles, just like this one eventually. Here's my work below.
Private Sub UserForm_Initialize()
CheckBox1.Caption = "Value is True"
CheckBox1.Value = True
CheckBox1.TripleState = False
ToggleButton1.Caption = "1ENG/OFF1ENG"
ToggleButton1.Value = Null
ToggleButton1.TripleState = True
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub ToggleButton1_Change()
If IsNull(ToggleButton1.Value) Then
ToggleButton1.Caption = "1ENG/OFF1ENG"
ToggleButton1.BackColor = RGB(255, 255, 255)
ElseIf ToggleButton1.Value = True Then
ToggleButton1.Caption = "PASS"
ToggleButton1.BackColor = RGB(0, 128, 64)
ElseIf ToggleButton1.Value = False Then
ToggleButton1.BackColor = RGB(255, 0, 0)
TextBox1.SetFocus
End If
End Sub
I set my toggle's triplestate=TRUE and the FALSE state sets focus to a text field, yeah!
Now, I want what I type in the text field to appear as the new caption of the toggle I just came from. Any ideas? This same text field will need to be reused for many more toggles, just like this one eventually. Here's my work below.
Private Sub UserForm_Initialize()
CheckBox1.Caption = "Value is True"
CheckBox1.Value = True
CheckBox1.TripleState = False
ToggleButton1.Caption = "1ENG/OFF1ENG"
ToggleButton1.Value = Null
ToggleButton1.TripleState = True
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub ToggleButton1_Change()
If IsNull(ToggleButton1.Value) Then
ToggleButton1.Caption = "1ENG/OFF1ENG"
ToggleButton1.BackColor = RGB(255, 255, 255)
ElseIf ToggleButton1.Value = True Then
ToggleButton1.Caption = "PASS"
ToggleButton1.BackColor = RGB(0, 128, 64)
ElseIf ToggleButton1.Value = False Then
ToggleButton1.BackColor = RGB(255, 0, 0)
TextBox1.SetFocus
End If
End Sub