VB经纬度与图幅号的相互转换程序.doc_第1页
VB经纬度与图幅号的相互转换程序.doc_第2页
VB经纬度与图幅号的相互转换程序.doc_第3页
VB经纬度与图幅号的相互转换程序.doc_第4页
VB经纬度与图幅号的相互转换程序.doc_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

VB经纬度与图幅号转换程序代码1 Form1(图3.1)程序代码:(1) Command1:Private Sub Command1_Click()If Option1.Value = True Then Form1.Hide Form2.ShowElseIf Option2.Value = True Then Form1.Hide Form3.ShowElseIf Option1.Value = False And Option2.Value = False Then MsgBox 请选择模式!, 48, 错误提示End IfEnd Sub(2) Command2: Private Sub Command2_Click()EndEnd Sub (3) Command3:Private Sub Command3_Click()a = 软件介绍:b = 本软件适用于我国范围内的经纬度与地形图图幅号相互转换c = 联系方式:QQ 497159625d = a + vbCrLf + b + vbCrLf + ce = MsgBox(d, 0, 关于)End Sub2 Form2(图3.2)程序代码:(1)Form:Private Sub Form_Load()Text3.Enabled = FalseEnd Sub(2)Command1:Private Sub Command1_Click()If Text1.Text = Or Text2.Text = Or Val(Text1.Text) 138 Or Val(Text2.Text) 60 ThenMsgBox 请正确输入经纬度!, 48, 错误提示End Ifj = Val(Text1.Text)w = Val(Text2.Text)jd = Int(j) + (Int(j * 100) Mod 100) / 60 + (j * 10000) Mod 100) / 3600wd = Int(w) + (Int(w * 100) Mod 100) / 60 + (w * 10000) Mod 100) / 3600x = Int(wd) Mod 4 + wd - Int(wd)y = Int(jd) Mod 6 + jd - Int(jd)a = Chr(Int(wd / 4) + 65)b = Str(Int(jd / 6) + 31)If Option1.Value = True Then Text3.Text = a & bElseIf Option2.Value = True Then c = 2 - Int(x / 2) d = Int(y / 3) + 1 h = Format(c, 000) l = Format(d, 000)Text3.Text = a & b & B & h & & lElseIf Option3.Value = True Then c = 4 - Int(x / 1) d = Int(y / 1.5) + 1 h = Format(c, 000) l = Format(d, 000) Text3.Text = a & b & C & h & & lElseIf Option4.Value = True Then c = 12 - Int(x / (1 / 3) d = Int(y / 0.5) + 1 h = Format(c, 000) l = Format(d, 000) Text3.Text = a & b & D & h & & lElseIf Option5.Value = True Then c = 24 - Int(x / (1 / 6) d = Int(y / 0.25) + 1 h = Format(c, 000) l = Format(d, 000) Text3.Text = a & b & E & h & & lElseIf Option6.Value = True Then c = 48 - Int(x / (1 / 12) d = Int(y / (1 / 8) + 1 h = Format(c, 000) l = Format(d, 000) Text3.Text = a & b & F & h & & lElseIf Option7.Value = True Then c = 96 - Int(x / (1 / 24) d = Int(y / (23 / 400) + 1 h = Format(c, 000) l = Format(d, 000) Text3.Text = a & b & G & h & & lElseIf Option8.Value = True Then c = 192 - Int(x / (1.25 / 60) d = Int(y / (0.03125) + 1 h = Format(c, 000) l = Format(d, 000) Text3.Text = a & b & H & h & & lElseMsgBox 请先选择比例尺!, 48, 错误提示End IfEnd Sub(2)Command2:Private Sub Command2_Click()Text1.Text = Text2.Text = Text3.Text = End Sub(3)Command3:Private Sub Command3_Click()a = 我国经度范围 72138b = 我国纬度范围052c = 请输入我国范围内的经纬度:d = 例:392230则输入:39.2230e = a + vbCrLf + b + vbCrLf + c + vbCrLf + df = MsgBox(e, 0, 输入说明:)End Sub(4)Command4:Private Sub Command4_Click()Form2.HideForm1.ShowEnd Sub(5)Command5:Private Sub Command5_Click()EndEnd Sub3 Form3(图3.3)程序代码:(1) Command1:If Text1.Text = A Or Text1.Text = a Then a = 1ElseIf Text1.Text = B Or Text1.Text = b Then a = 2ElseIf Text1.Text = C Or Text1.Text = c Then a = 3ElseIf Text1.Text = D Or Text1.Text = d Then a = 4ElseIf Text1.Text = E Or Text1.Text = e Then a = 5ElseIf Text1.Text = F Or Text1.Text = f Then a = 6ElseIf Text1.Text = G Or Text1.Text = g Then a = 7ElseIf Text1.Text = H Or Text1.Text = h Then a = 8ElseIf Text1.Text = I Or Text1.Text = i Then a = 9ElseIf Text1.Text = J Or Text1.Text = j Then a = 10ElseIf Text1.Text = K Or Text1.Text = k Then a = 11ElseIf Text1.Text = L Or Text1.Text = l Then a = 12ElseIf Text1.Text = M Or Text1.Text = m Then a = 13ElseIf Text1.Text = N Or Text1.Text = n Then a = 14Else MsgBox 请输入我国范围内的图幅行号!, 48, 错误提示End IfIf Val(Text2.Text) 53 Or Text1.Text = Or Text2.Text = Or Text4.Text = Or Text5.Text = Then MsgBox 请输入我国范围内的图幅列号!, 48, 错误提示End If b = Val(Text2.Text)h = Format(Text4.Text, #)l = Format(Text5.Text, #)c = Val(h)d = Val(l) If Text3.Text = A Or Text3.Text = a Then jd = (b - 31) * 6 + (d - 1) * 6 wd = (a - 1) * 4 + (4 / 4 - c) * 4 Text6.Text = Int(jd) Text7.Text = Int(jd - Int(jd) * 60) Text8.Text = CInt(jd - Int(jd) * 60 - Val(Text7.Text) Text9.Text = Int(wd) Text10.Text = Int(wd - Int(wd) * 60) Text11.Text = CInt(wd - Int(wd) * 60 - Val(Text10.Text) ElseIf Text3.Text = B Or Text3.Text = b Then jd = (b - 31) * 6 + (d - 1) * 3 wd = (a - 1) * 4 + (4 / 2 - c) * 2 Text6.Text = Int(jd) Text7.Text = Int(jd - Int(jd) * 60) Text8.Text = CInt(jd - Int(jd) * 60 - Val(Text7.Text) Text9.Text = Int(wd) Text10.Text = Int(wd - Int(wd) * 60) Text11.Text = CInt(wd - Int(wd) * 60 - Val(Text10.Text) ElseIf Text3.Text = C Or Text3.Text = c Then jd = (b - 31) * 6 + (d - 1) * 1.5 wd = (a - 1) * 4 + (4 / 1 - c) * 1 Text6.Text = Int(jd) Text7.Text = Int(jd - Int(jd) * 60) Text8.Text = CInt(jd - Int(jd) * 60 - Val(Text7.Text) Text9.Text = Int(wd) Text10.Text = Int(wd - Int(wd) * 60) Text11.Text = CInt(wd - Int(wd) * 60 - Val(Text10.Text)ElseIf Text3.Text = D Or Text3.Text = d Then jd = (b - 31) * 6 + (d - 1) * 0.5 wd = (a - 1) * 4 + (4 / (1 / 3) - c) * (1 / 3) Text6.Text = Int(jd) Text7.Text = Int(jd - Int(jd) * 60) Text8.Text = CInt(jd - Int(jd) * 60 - Val(Text7.Text) Text9.Text = Int(wd) Text10.Text = Int(wd - Int(wd) * 60) Text11.Text = CInt(wd - Int(wd) * 60 - Val(Text10.Text) ElseIf Text3.Text = E Or Text3.Text = e Then jd = (b - 31) * 6 + (d - 1) * 0.25 wd = (a - 1) * 4 + (4 / (1 / 6) - c) * (1 / 6) Text6.Text = Int(jd) Text7.Text = Int(jd - Int(jd) * 60) Text8.Text = CInt(jd - Int(jd) * 60 - Val(Text7.Text) Text9.Text = Int(wd) Text10.Text = Int(wd - Int(wd) * 60) Text11.Text = CInt(wd - Int(wd) * 60 - Val(Text10.Text) ElseIf Text3.Text = F Or Text3.Text = f Then jd = (b - 31) * 6 + (d - 1) * 7.5 wd = (a - 1) * 4 + (4 / (1 / 12) - c) * (1 / 12) Text6.Text = Int(jd) Text7.Text = Int(jd - Int(jd) * 60) Text8.Text = CInt(jd - Int(jd) * 60 - Val(Text7.Text) Text9.Text = Int(wd) Text10.Text = Int(wd - Int(wd) * 60) Text11.Text = CInt(wd - Int(wd) * 60 - Val(Text10.Text) ElseIf Text3.Text = G Or Text3.Text = g Then jd = (b - 31) * 6 + (d - 1) * (23 / 400) wd = (a - 1) * 4 + (4 / (1 / 24) - c) * (1 / 24) Text6.Text = Int(jd) Text7.Text = Int(jd - Int(jd) * 60) Text8.Text = CInt(jd - Int(jd) * 60 - Val(Text7.Text) Text9.Text = Int(wd) Text10.Text = Int(wd - Int(wd) * 60) Text11.Text = CInt(wd - Int(wd) * 60 - Val(Text10.Text) ElseIf Text3.Text = H Or Text3.Text = h Then jd = (b - 31) * 6 + (d - 1) * (0.03125) wd = (a - 1) * 4 + (4 / (1.25 / 60) - c) * (1.25 / 60) Text6.Text = Int(jd) Text7.Text = Int(jd - Int(jd) * 60) Text8.Text = CInt(jd - Int(jd) * 60 - Val(Text7.Text) Text9.Text = Int(wd) Text10.Text = Int(wd - Int(wd) * 60) Text11.Text = CInt(wd - Int(wd) * 60 - Val(Text10.Text) Else MsgBox 请输入正确的比例尺代码, 48, 错误提示:End IfEnd Sub(2)Command2:Private Sub Command2_Click()Text1.Text = Text2.Text = Text3.Text = Text4.Text = Text5.Text = Text6.Text = Text7.T

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论