Lengtematen: broncode
- De basiseenheden die we intern gebruiken zijn voeten en meters
Dim voet As Double
Dim meter As Double
- Dit is de conversie van decimaal naar US:
Private Sub cmdDecUS_Click()
If txtDec.Text = "" Then Exit Sub
If Not IsNumeric(txtDec.Text) Then Exit Sub
If optCm.Value = True Then
txtUs.Text = txtDec.Text / 2.54
optInch.Value = True
End If
If optMeter.Value = True Then
txtUs.Text = txtDec.Text / 0.9144
optYard.Value = True
End If
If optKm.Value = True Then
txtUs.Text = txtDec.Text / 1.609
optMile.Value = True
End If
End Sub
- Dit is de conversie van US naar decimaal:
Private Sub cmdUSDec_Click()
If txtUs.Text = "" Then Exit Sub
If Not IsNumeric(txtUs.Text) Then Exit Sub
If optInch.Value = True Then
txtDec.Text = txtUs.Text * 2.54
optCm.Value = True
End If
If optFoot.Value = True Then
txtDec.Text = txtUs.Text * 0.3084
optMeter.Value = True
End If
If optYard.Value = True Then
txtDec.Text = txtUs.Text * 0.9144
optMeter.Value = True
End If
If optMile.Value = True Then
txtDec.Text = txtUs.Text * 1.609
optKm.Value = True
End If
End Sub
[VB Web] - [hlrnet] - [copyright]