版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、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
2、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_clic
3、k()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 =
4、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 & & lels
5、eif 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 opti
6、on5.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 o
7、ption7.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 &
8、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
9、, 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 =
10、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 =
11、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, 错
12、误提示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
13、 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
14、 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) el
15、seif 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(
16、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
17、.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
18、) * 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 =
19、 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
20、/ (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
21、= (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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年吉林省和龙市高三数学下册期末考试模拟试卷附答案(黄金题型)
- 2026年福建省永安市高三数学下册期末考试模拟测试卷含答案【综合卷】
- (附表五)工程建设监理档案
- 2026年山东省寿光市高三数学下册期末考试模拟卷及答案(各地真题)
- 2026年云南省香格里拉市高三数学下册期末考试模拟试卷附完整答案(有一套)
- 2026年海南省琼海市高三数学下册期末考试模拟试卷含完整答案【网校专用】
- 2026年四川省绵竹市高三数学下册期末考试模拟卷【含答案】
- 高校学生宿舍消防隐患排查指南
- 酒店餐饮服务部服务效率与客户满意度KPI考核表
- 旅游产品策划师行程设计及执行KPI考核表
- 高压电力用户配电室智能化运维规范
- 托育机构消防培训课件
- 《建筑设备工程CAD制图与识图》05-空调通风工程
- 应对暴雪天气安全应急预案
- 植树造林施工方案
- 知名连锁汉堡店食安QSC稽核表
- 生产设备设施安全检测、维护及报废管理制度范文(2篇)
- 叉车工岗位安全培训
- 本霍根的五堂课中文版
- 高二美术(人教版)第一课《绘画的诞生(落笔)》
- 南方医科大学南方医院冠心病不稳定型心绞痛住院费用合计5585763元
评论
0/150
提交评论