New to programming need help for stupid query.
-
This is going to sound stupid to you, but iv'e only just started programming :wtf:(a few hours ago, just playing around, no books) anyway, I'm trying to change the enabled property of a textbox when there is input, I'm using the following, and the enabled property of the button is set to false at design time.
Private Sub btnlogin_EnabledChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnlogin.EnabledChanged If txtpassword.Text = "" Then btnlogin.Enabled = False Else btnlogin.Enabled = True End If
Please help me Thanks:sigh: -
This is going to sound stupid to you, but iv'e only just started programming :wtf:(a few hours ago, just playing around, no books) anyway, I'm trying to change the enabled property of a textbox when there is input, I'm using the following, and the enabled property of the button is set to false at design time.
Private Sub btnlogin_EnabledChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnlogin.EnabledChanged If txtpassword.Text = "" Then btnlogin.Enabled = False Else btnlogin.Enabled = True End If
Please help me Thanks:sigh:Hi, Guess you should use the use the textchanged on the textbox setting the enable property on the btnlogin instead of using the enabledchanged on the button, as this would require the button property to change before the code is executed :) Cheers DJ Think, try, think, think, try, think, think, think, try, ASK, think, try, advance on step and start over...
-
This is going to sound stupid to you, but iv'e only just started programming :wtf:(a few hours ago, just playing around, no books) anyway, I'm trying to change the enabled property of a textbox when there is input, I'm using the following, and the enabled property of the button is set to false at design time.
Private Sub btnlogin_EnabledChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnlogin.EnabledChanged If txtpassword.Text = "" Then btnlogin.Enabled = False Else btnlogin.Enabled = True End If
Please help me Thanks:sigh:"I'm trying to change the enabled property of a textbox when there is input"...??? Private Sub txtpassword_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged If txtpassword.Text = "" Then btnlogin.Enabled = False Else btnlogin.Enabled = True End If End Sub
-
"I'm trying to change the enabled property of a textbox when there is input"...??? Private Sub txtpassword_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged If txtpassword.Text = "" Then btnlogin.Enabled = False Else btnlogin.Enabled = True End If End Sub