Isac Active Member Licensed User Longtime User Jan 25, 2015 #1 Hello How do I pass a false when the release button? Thank You Code: Sub Button1_Click If Button1.Enabled=True Then Button1.Text="ON" Else Button1.Text="OFF" End If End Sub
Hello How do I pass a false when the release button? Thank You Code: Sub Button1_Click If Button1.Enabled=True Then Button1.Text="ON" Else Button1.Text="OFF" End If End Sub
S susu Well-Known Member Licensed User Longtime User Jan 25, 2015 #2 Code: Sub Button1_Click If Button1.Enabled=True Then Button1.Text="OFF" Button1.Enable = False Else Button1.Text="ON" Button1.Enable = True End If End Sub Upvote 0
Code: Sub Button1_Click If Button1.Enabled=True Then Button1.Text="OFF" Button1.Enable = False Else Button1.Text="ON" Button1.Enable = True End If End Sub
Isac Active Member Licensed User Longtime User Jan 25, 2015 #3 It does not change the text, remains locked OFF Upvote 0
NJDude Expert Licensed User Longtime User Jan 25, 2015 #4 That code won't work because once the button is disabled you cannot click on it, you should use a Toggle button. Upvote 0
That code won't work because once the button is disabled you cannot click on it, you should use a Toggle button.
S susu Well-Known Member Licensed User Longtime User Jan 25, 2015 #5 NJDude said: That code won't work because once the button is disabled you cannot click on it, you should use a Toggle button. Click to expand... You're right, I replied on my phone and did not check it on B4A. Upvote 0
NJDude said: That code won't work because once the button is disabled you cannot click on it, you should use a Toggle button. Click to expand... You're right, I replied on my phone and did not check it on B4A.
S susu Well-Known Member Licensed User Longtime User Jan 25, 2015 #6 Isac said: It does not change the text, remains locked OFF Click to expand... Sorry, I was wrong. You can use 2 buttons ButtonOn and ButtonOff. You can change the state by using a global var then enable/visible it. However, it's better to use Toggle button like NJDude suggested. Upvote 0
Isac said: It does not change the text, remains locked OFF Click to expand... Sorry, I was wrong. You can use 2 buttons ButtonOn and ButtonOff. You can change the state by using a global var then enable/visible it. However, it's better to use Toggle button like NJDude suggested.
ivan.tellez Active Member Licensed User Longtime User Jan 25, 2015 #7 Thats easy... Code: Sub Button1_Click If Button1.Text="OFF" Then Button1.Text="ON" '...Code to turn on whatever Else Button1.Text="OFF" '...Code to turn off whatever End If End Sub Note that the button is never actually disabled. Last edited: Jan 25, 2015 Upvote 0
Thats easy... Code: Sub Button1_Click If Button1.Text="OFF" Then Button1.Text="ON" '...Code to turn on whatever Else Button1.Text="OFF" '...Code to turn off whatever End If End Sub Note that the button is never actually disabled.
Isac Active Member Licensed User Longtime User Jan 25, 2015 #8 Code: Sub Button1_Click If Button1.Text="OFF" Then Button1.Text="ON" ...Code to turn on whatever Else Button1.Text="OFF" ...Code to turn off whatever End If End Sub Upvote 0
Code: Sub Button1_Click If Button1.Text="OFF" Then Button1.Text="ON" ...Code to turn on whatever Else Button1.Text="OFF" ...Code to turn off whatever End If End Sub