1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Private Sub buttonconvertlong_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonconvertlong.Click
Dim DD, deg, min, sec As Double
Dim dir As String
deg = CDbl(gm862long.Text.Substring(0, 3))
min = CDbl(gm862long.Text.Substring(3, 7))
sec = min / 60
dir = CStr(gm862long.Text.Substring(11, 1))
DD = deg + sec
'Negative for West
If dir = "W" Then
DD = DD * -1
txtlongitude.Text = CStr(DD)
ElseIf dir = "E" Then
'positive for East
txtlongitude.Text = CStr(DD)
End If
End Sub |
Partager