Shane Partridge
Visual Basic 2013
The Code
Public Class Form19
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
'## ======Calculate Distance over Speed ============== ##
'## ====== Dimension Variables ==================== ##
Dim tkm, hrs, ttkm, kph, xhrs As Single, N As String = "n2"
'## ======================================== ##
'## ======= Assign Variables & Text Boxes ============= ##
tkm = TextBox1.Text
hrs = TextBox2.Text
ttkm = TextBox3.Text
'## ========================================= ##
'## ========== Calculus Equations =================== ##
kph = (tkm / hrs)
xhrs = ttkm / kph
'## ========================================= ##
'## ========= Assign Variables to Labels =============== ##
Label1.Text = xhrs.ToString(N)
Label2.Text = kph.ToString(N)
Label3.Text = xhrs.ToString(N)
Label4.Text = ttkm.ToString(N)
'## ========================================== ##
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Form17.Show()
Me.Hide()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
'## ========== Clear Text & Label Boxes as Null String ============ ##
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
Label1.Text = ""
Label2.Text = ""
Label3.Text = ""
Label4.Text = ""
'## ================================================ ##
End Sub
End Class