我想在textbox 中直接输入经纬度坐标 比如要输入36°03′12〃 输入36后面就直接加上°输入03 后面就自动加上′怎么弄? 我不想用label加在textbox后 输入不方便,求大虾帮助

解决方案 »

  1.   

    如果输入经纬度值>=100°,按lz的逻辑应是10°0,问lz这种情况怎么办
      

  2.   

    你自己做下防错处理吧Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode >= 96 And KeyCode <= 105 Then'当输入的是数字时判断
        If Len(Text1.Text) = 2 Then
            Text1.Text = Text1.Text & "°"
        ElseIf Len(Text1.Text) = 5 Then
            Text1.Text = Text1.Text & "'"
        ElseIf Len(Text1.Text) = 8 Then
            Text1.Text = Text1.Text & """"
        End If
        Text1.SelStart = Len(Text1.Text)‘确定光标位置
        Text1.SelLength = Len(Text1.Text)
    End If
    End Sub
      

  3.   

    就是这个问题一直让我犯难 , 经度<=180 而纬度<=90