Sub GPS_LocationChanged (Location1 As Location)
Lat1 = Location1.Latitude
Long1 = Location1.Longitude
Altitude = Location1.Altitude
Dim str As String
Dim digits As Int
Dim sep As String
OSGB.WGS84toOSGB36(Lat1, Long1, Altitude)
str = OSGB.OSGB36toNGR(OSGB.NewLatitude, OSGB.NewLongitude)
digits = 5
sep = " "
ngr = "GridRef: " & str.SubString2(0, 2) & sep & str.SubString2(2, digits + 2)
ngr = ngr & sep & str.SubString2(7, digits + 7) & CRLF
If Local = "English (United Kingdom)" Then
East = NumberFormat2(OSGB.Easting, 1, 0, 0, False)
North = NumberFormat2(OSGB.Northing, 1, 0, 0, False)
ngr = ngr & "National Grid: " & East & " " & North & CRLF
Else
East = 0
North = 0
EastTxt.Text = Lat1
NorthTxt.Text = Long1
Tgl1.Checked = True
Tgl1.Enabled = False
End If
Select Tgl1.Checked
Case True
EastTxt.Text = Lat1
NorthTxt.Text = Long1
Case False
EastTxt.Text = East
NorthTxt.Text = North
End Select
EastTxt.Invalidate
NorthTxt.Invalidate
End Sub