资源描述:
《vb经纬度与图幅号的相互转换程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、VB经纬度与图幅号转换程序代码1Form1(图3.1)程序代码:(1)Command1:PrivateSubCommand1_Click()IfOption1.Value=TrueThenForm1.HideForm2.ShowElseIfOption2.Value=TrueThenForm1.HideForm3.ShowElseIfOption1.Value=FalseAndOption2.Value=FalseThenMsgBox"请选择模式!",48,"错误提示"EndIfEndSub(2)Command2:PrivateSubCommand2_Click()EndEndS
2、ub(3)Command3:PrivateSubCommand3_Click()a="软件介绍:"b="本软件适用于我国范围内的经纬度与地形图图幅号相互转换"c="联系方式:QQ497159625"d=a+vbCrLf+b+vbCrLf+ce=MsgBox(d,0,"关于")EndSub2Form2(图3.2)程序代码:(1)Form:PrivateSubForm_Load()Text3.Enabled=FalseEndSub(2)Command1:PrivateSubCommand1_Click()IfText1.Text=""OrText2.Text=""OrVal(Text
3、1.Text)<72OrVal(Text1.Text)>138OrVal(Text2.Text)<0OrVal(Text2.Text)>60ThenMsgBox"请正确输入经纬度!",48,"错误提示"EndIfj=Val(Text1.Text)w=Val(Text2.Text)jd=Int(j)+(Int(j*100)Mod100)/60+((j*10000)Mod100)/3600wd=Int(w)+(Int(w*100)Mod100)/60+((w*10000)Mod100)/3600x=Int(wd)Mod4+wd-Int(wd)y=Int(jd)Mod6+jd-Int(
4、jd)a=Chr(Int(wd/4)+65)b=Str(Int(jd/6)+31)IfOption1.Value=TrueThenText3.Text=a&bElseIfOption2.Value=TrueThenc=2-Int(x/2)d=Int(y/3)+1h=Format(c,"000")l=Format(d,"000")Text3.Text=a&b&"B"&h&""&lElseIfOption3.Value=TrueThenc=4-Int(x/1)d=Int(y/1.5)+1h=Format(c,"000")l=Format(d,"000")Text3.Text=a&b&
5、"C"&h&""&lElseIfOption4.Value=TrueThenc=12-Int(x/(1/3))d=Int(y/0.5)+1h=Format(c,"000")l=Format(d,"000")Text3.Text=a&b&"D"&h&""&lElseIfOption5.Value=TrueThenc=24-Int(x/(1/6))d=Int(y/0.25)+1h=Format(c,"000")l=Format(d,"000")Text3.Text=a&b&"E"&h&""&lElseIfOption6.Value=TrueThenc=48-Int(x/(1/12))
6、d=Int(y/(1/8))+1h=Format(c,"000")l=Format(d,"000")Text3.Text=a&b&"F"&h&""&lElseIfOption7.Value=TrueThenc=96-Int(x/(1/24))d=Int(y/(23/400))+1h=Format(c,"000")l=Format(d,"000")Text3.Text=a&b&"G"&h&""&lElseIfOption8.Value=TrueThenc=192-Int(x/(1.25/60))d=Int(y/(0.03125))+1h=Format(c,"000")l=Forma
7、t(d,"000")Text3.Text=a&b&"H"&h&""&lElseMsgBox"请先选择比例尺!",48,"错误提示"EndIfEndSub(2)Command2:PrivateSubCommand2_Click()Text1.Text=""Text2.Text=""Text3.Text=""EndSub(3)Command3:PrivateSubCommand3_Click()a="我国经度范围72°~138°"b="我国纬度范围0°~52°"c="请输入我国范围内