Private Sub cmdBereken_Click()
Dim snelheid As Single
Dim remafstand As Single
Dim stopafstand As Single
Dim reactiefastand As Single
Dim wekdegnat As Boolean
If Not IsNumeric(txtSnelheid.Text) Then
Exit Sub
snelheid = CSng(txtSnelheid.Text)
wekdegnat = chkNatwegdek.Value 'true
indien true, false idnien false
remafstand = (snelheid / 10) ^ 2 / 2
If wekdegnat Then remafstand = remafstand
* 1.5
reactieafstand = (snelheid /
10) * 3
stopafstand = remafstand +
reactieafstand
bericht = "Je snelheid is "
& snelheid & " km/u." & vbCrLf
bericht = bericht & "De
remafstand is " & remafstand & " m." & vbCrLf
bericht = bericht & "De
reactieafstand is " & reactieafstand & " m." & vbCrLf
bericht = bericht & "De
stopafstand is " & stopafstand & " m."
Me.lblResultaat.Caption =
bericht
'in .NET: lblResultaat.Text
End Sub
[VB Web] - [Leren programmeren] - [hlrnet] - [copyright]