new to VB.net. I’m trying to create a hypothetical project. please see attachments!
I have a win-form (see car2 attachment) with x3 textboxes:
Textbox1 = Car-Len
Textbox2 = Car-Height
Textbox3 = Car-Width
and lots of labels.
The idea is:
input car Length, Width, Height in to their textboxes and if (for example: London Garage has a value greater than – say Length, then Y appears in a Label next to London and same for other two boxes. Hope that made sense.
So in a nut shell: I put dimensions of a car into Textboxes and if compared to Garage London dimensions, then label(s) say yes or no... so, basically, does the car fit in garage - phew!!!
Below is my shocking attempt at code (WHICH DOESN'T WORK) (i suspect it's something to do with string to int conversion - I'm just guessing!
Dim LondonH As Integer = 5 ' 8 feet
Dim LondonW As Integer = 5 ' 9 to 10 feet wide
Dim LondonL As Integer = 13 '18 to 20 feet long
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Label1.Text = "London"
Label2.Text = "Paris"
Label3.Text = "Italy"
Private Sub TextBox3_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox3.TextChanged
If Val(TextBox1.Text) < LondonL Then
Label7.Text = "n"
ElseIf Val(TextBox1.Text) > LondonL Then
Label7.Text = "y"