Hi All.
First an explaination of my plans.
I have 6 textboxes set to calculate final drive ratios.Textbox 1 is enabled at form load,all others disabled.
What I want is for the user to enter his number of gears,from 1 to 5,into Textbox1 to enable only the text boxes he will need
for the calculations.
For example If he only has a 3 speed ,then 3 will be entered into Textbox1 and only textboxes 2,3, and 4 will be enabled.
I have it this far,but when I clear textbox 1 the textboxes enabled don't disable, and throws an error."A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll"
Code example provided is for 1 gear for simplicity.
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text = 1 Then
TextBox2.Enabled = True
Else : TextBox2.Enabled = False
End If
End Sub
What am I doing wrong?
First an explaination of my plans.
I have 6 textboxes set to calculate final drive ratios.Textbox 1 is enabled at form load,all others disabled.
What I want is for the user to enter his number of gears,from 1 to 5,into Textbox1 to enable only the text boxes he will need
for the calculations.
For example If he only has a 3 speed ,then 3 will be entered into Textbox1 and only textboxes 2,3, and 4 will be enabled.
I have it this far,but when I clear textbox 1 the textboxes enabled don't disable, and throws an error."A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll"
Code example provided is for 1 gear for simplicity.
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text = 1 Then
TextBox2.Enabled = True
Else : TextBox2.Enabled = False
End If
End Sub
What am I doing wrong?