diff --git a/Form1.frm b/Form1.frm index 45fdf6e..4564b80 100644 --- a/Form1.frm +++ b/Form1.frm @@ -1,11 +1,11 @@ VERSION 5.00 Begin VB.Form Form1 - BorderStyle = 4 'Fixed ToolWindow - Caption = "身高计算器" - ClientHeight = 1545 - ClientLeft = 3390 - ClientTop = 2040 - ClientWidth = 3030 + BorderStyle = 1 'Fixed Single + Caption = "长度单位转换器" + ClientHeight = 1560 + ClientLeft = 3750 + ClientTop = 2070 + ClientWidth = 3615 BeginProperty Font Name = "微软雅黑" Size = 9 @@ -15,122 +15,273 @@ Begin VB.Form Form1 Italic = 0 'False Strikethrough = 0 'False EndProperty + Icon = "Form1.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False - ScaleHeight = 1545 - ScaleWidth = 3030 - ShowInTaskbar = 0 'False + ScaleHeight = 1560 + ScaleWidth = 3615 StartUpPosition = 1 '所有者中心 - Begin VB.CommandButton Command4 - Caption = "清空(&C)" + Begin VB.ComboBox Combo2 Height = 375 - Left = 1200 - TabIndex = 7 - Top = 1080 - Width = 855 + ItemData = "Form1.frx":048A + Left = 1980 + List = "Form1.frx":04D9 + Style = 2 'Dropdown List + TabIndex = 6 + ToolTipText = "结果单位" + Top = 600 + Width = 1515 End - Begin VB.CommandButton Command3 - Caption = "退出(&E)" + Begin VB.ComboBox Combo1 Height = 375 - Left = 2160 - TabIndex = 6 - Top = 1080 - Width = 735 + ItemData = "Form1.frx":05E7 + Left = 1980 + List = "Form1.frx":0636 + Style = 2 'Dropdown List + TabIndex = 5 + ToolTipText = "原单位" + Top = 120 + Width = 1515 End Begin VB.CommandButton Command2 - Caption = ">厘米" + Caption = "清空(&C)" Height = 375 - Left = 2160 - TabIndex = 5 - Top = 600 - Width = 735 + Left = 1680 + Style = 1 'Graphical + TabIndex = 3 + ToolTipText = "清空数字" + Top = 1080 + Width = 855 End Begin VB.CommandButton Command1 - Caption = ">米 " + Caption = "退出(&E)" Height = 375 - Left = 2160 - TabIndex = 4 - Top = 120 - Width = 735 + Left = 2640 + Style = 1 'Graphical + TabIndex = 2 + ToolTipText = "退出程序" + Top = 1080 + Width = 855 End Begin VB.TextBox Text2 + Enabled = 0 'False Height = 375 - Left = 840 - TabIndex = 3 + Left = 120 + Locked = -1 'True + TabIndex = 1 + ToolTipText = "结果" Top = 600 - Width = 1215 + Width = 1815 End Begin VB.TextBox Text1 Height = 375 - Left = 840 - TabIndex = 2 + Left = 120 + TabIndex = 0 + ToolTipText = "原数据" Top = 120 - Width = 1215 + Width = 1815 End - Begin VB.Label Label3 + Begin VB.Label Label1 BackColor = &H80000004& Caption = "by Session" ForeColor = &H80000011& Height = 255 - Left = 120 - TabIndex = 8 - Top = 1200 + Left = 240 + TabIndex = 4 + Top = 1150 Width = 975 End - Begin VB.Label Label2 - Caption = "厘米:" - BeginProperty Font - Name = "微软雅黑" - Size = 10.5 - Charset = 134 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 120 - TabIndex = 1 - Top = 600 - Width = 855 - End - Begin VB.Label Label1 - Caption = " 米:" - BeginProperty Font - Name = "微软雅黑" - Size = 10.5 - Charset = 134 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 120 - TabIndex = 0 - Top = 120 - Width = 735 - End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False -Private Sub Command1_Click() - Let Text2.Text = Val(Text1.Text) * 100 '将厘米设为米的100倍 +Dim m As String + +Public Sub CalcIn() + '以下为公制单位 + If Combo1.Text = "厘米(㎝)" Then + Let m = Val(Text1.Text) / 100 + End If + If Combo1.Text = "米(m)" Then + Let m = Val(Text1.Text) + End If + If Combo1.Text = "毫米(㎜)" Then + Let m = Val(Text1.Text) / 1000 + End If + If Combo1.Text = "分米(dm)" Then + Let m = Val(Text1.Text) / 10 + End If + If Combo1.Text = "纳米(nm)" Then + Let m = Val(Text1.Text) * (10 ^ -9) + End If + If Combo1.Text = "微米(μm)" Then + Let m = Val(Text1.Text) * (10 ^ -6) + End If + If Combo1.Text = "千米(㎞)" Then + Let m = Val(Text1.Text) * 1000 + End If + '公制单位完成 + '以下为市制单位 + If Combo1.Text = "(市)里" Then + Let m = Val(Text1.Text) * 500 + End If + If Combo1.Text = "(市)引" Then + Let m = Val(Text1.Text) * (100 / 3) + End If + If Combo1.Text = "(市)丈" Then + Let m = Val(Text1.Text) / 0.3 + End If + If Combo1.Text = "(市)尺" Then + Let m = Val(Text1.Text) / 3 + End If + If Combo1.Text = "(市)寸" Then + Let m = Val(Text1.Text) / 30 + End If + If Combo1.Text = "(市)分" Then + Let m = Val(Text1.Text) / 300 + End If + If Combo1.Text = "(市)厘" Then + Let m = Val(Text1.Text) / 3000 + End If + '以上为市制单位 + '以下为英制单位 + If Combo1.Text = "英里(mi)" Then + Let m = Val(Text1.Text) * 1690.9344 + End If + If Combo1.Text = "码(yd)" Then + Let m = Val(Text1.Text) * 0.9144 + End If + If Combo1.Text = "英尺(ft)" Then + Let m = Val(Text1.Text) * 0.3048 + End If + If Combo1.Text = "英寸(in)" Then + Let m = Val(Text1.Text) * 0.0254 + End If + '以上为英制单位 + '以下为不常用单位 + If Combo1.Text = "海里(n mile)" Then + Let m = Val(Text1.Text) * 1852 + End If + If Combo1.Text = "光年(ly)" Then + Let m = Val(Text1.Text) * (9.4607304725808 * 10 ^ 15) + End If + If Combo1.Text = "天文单位(A.U.)" Then + Let m = Val(Text1.Text) * (1.495978707 * 10 ^ 11) + End If + '以上为不常用单位 End Sub -Private Sub Command2_Click() - Let Text1.Text = Val(Text2.Text) * 0.01 '将米设为厘米的0.01倍 +Public Sub CalcOut() + '以下为公制单位 + If Combo2.Text = "厘米(㎝)" Then + Let Text2.Text = Val(m) * 100 + End If + If Combo2.Text = "米(m)" Then + Let Text2.Text = Val(m) + End If + If Combo2.Text = "毫米(㎜)" Then + Let Text2.Text = Val(m) * 1000 + End If + If Combo2.Text = "分米(dm)" Then + Let Text2.Text = Val(m) * 10 + End If + If Combo2.Text = "纳米(nm)" Then + Let Text2.Text = Val(m) / (10 ^ -9) + End If + If Combo2.Text = "微米(μm)" Then + Let Text2.Text = Val(m) / (10 ^ -6) + End If + If Combo2.Text = "千米(㎞)" Then + Let Text2.Text = Val(m) / 1000 + End If + '公制单位完成 + '以下为市制单位 + If Combo2.Text = "(市)里" Then + Let Text2.Text = Val(m) / 500 + End If + If Combo2.Text = "(市)引" Then + Let Text2.Text = Val(m) / (100 / 3) + End If + If Combo2.Text = "(市)丈" Then + Let Text2.Text = Val(m) * 0.3 + End If + If Combo2.Text = "(市)尺" Then + Let Text2.Text = Val(m) * 3 + End If + If Combo2.Text = "(市)寸" Then + Let Text2.Text = Val(m) * 30 + End If + If Combo2.Text = "(市)分" Then + Let Text2.Text = Val(m) * 300 + End If + If Combo2.Text = "(市)厘" Then + Let Text2.Text = Val(m) * 3000 + End If + '以上为市制单位 + '以下为英制单位 + If Combo2.Text = "英里(mi)" Then + Let Text2.Text = Val(m) / 1690.9344 + End If + If Combo2.Text = "码(yd)" Then + Let Text2.Text = Val(m) / 0.9144 + End If + If Combo2.Text = "英尺(ft)" Then + Let Text2.Text = Val(m) / 0.3048 + End If + If Combo2.Text = "英寸(in)" Then + Let Text2.Text = Val(m) / 0.0254 + End If + '以上为英制单位 + '以下为不常用单位 + If Combo2.Text = "海里(n mile)" Then + Let Text2.Text = Val(m) / 1852 + End If + If Combo2.Text = "光年(ly)" Then + Let Text2.Text = Val(m) / (9.4607304725808 * 10 ^ 15) + End If + If Combo2.Text = "天文单位(A.U.)" Then + Let Text2.Text = Val(m) / (1.495978707 * 10 ^ 11) + End If + '以上为不常用单位 End Sub -Private Sub Command3_Click() - End '结束进程 + + + + +Private Sub Form_Load() + Let Combo1.Text = "厘米(㎝)" + Let Combo2.Text = "米(m)" End Sub -Private Sub Command4_Click() - Let Text1.Text = "" '清除米 - Let Text2.Text = "" '清除厘米 + + +Private Sub Combo1_Click() + Call CalcIn + Call CalcOut +End Sub +Private Sub Text1_Change() + Call CalcIn + Call CalcOut +End Sub +Private Sub Combo2_Click() + Call CalcIn + Call CalcOut +End Sub + + + +Private Sub Command1_Click() + End '结束进程 +End Sub + + +Private Sub Command2_Click() + Let Text1.Text = "" '清除输入文字 + Let Text2.Text = "" '清除输出文字 End Sub -Private Sub Label3_DblClick() - MsgBox "版权所有 (C) 2022 XhuOffice 保留所有权利", vbInformation, "XhuOffice" '版权信息 + + +Private Sub Label1_DblClick() + MsgBox "版权所有 (C) 2022 XhuOffice 保留所有权利", vbInformation, "XhuOffice" '版权信息 End Sub diff --git a/Form1.frx b/Form1.frx new file mode 100644 index 0000000..5bff0ff Binary files /dev/null and b/Form1.frx differ diff --git a/README.md b/README.md index d500afe..78d77ca 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,40 @@ # 韬珮璁$畻鍣 -鏈伐鍏蜂粎鐢ㄤ簬濞变箰涓庡涔犱氦娴侊紝鍩烘湰娌℃湁瀹為檯鐢ㄩ旓紒 +鏈伐鍏风敤浜庤繘琛岄暱搴﹀崟浣嶉棿鐨勬崲绠楋紝瀹炵敤鎬т笉寮猴紝浠呯敤浜庡涔犱氦娴併 ## 鐗规 -- 鑴氭湰鏀寔鑷姩璇嗗埆鍗曚綅锛堜粎鏀寔m鍜屻帩锛 +- 鏀寔**鍏埗鍗曚綅**銆**甯傚埗鍗曚綅**銆**鑻卞埗鍗曚綅**绛 - 搴旂敤绋嬪簭鍏煎鎬у己澶锛堝簾璇濓級 +## 鏀寔鐨勫崟浣 +- 鍏埗鍗曚綅 + - 鍗冪背(銕) + - 绫(m) + - 鍒嗙背(dm) + - 鍘樼背(銕) + - 姣背(銕) + - 寰背(渭m) + - 绾崇背(nm) +- 甯傚埗鍗曚綅 + - 閲 + - 寮 + - 涓 + - 灏 + - 瀵 + - 鍒 + - 鍘 +- 鑻卞埗鍗曚綅 + - 鑻遍噷(mi) + - 鐮(yd) + - 鑻卞昂(ft) + - 鑻卞昂(in) +- 鍏朵粬 + - 娴烽噷(n mile) + - 鍏夊勾(ly) + - 澶╂枃鍗曚綅(A.U.) + + ## 鏀寔鐨勬搷浣滅郴缁 - Windows 9x/Me/2000/XP/2003/Vista/7/8.x/10/11 @@ -23,7 +51,7 @@ 鐜板湪鎮ㄥ彲浠ュ湪鎮ㄩ夋嫨鐨勭洰褰曚笅鐪嬭缂栬瘧濂界殑`EXE`鏂囦欢浜嗐 ## 浣跨敤 -1. 鐩存帴杩愯`EXE`鎴朻VBS`鏂囦欢鍗冲彲 +1. 鐩存帴杩愯`EXE`鏂囦欢鍗冲彲 2. 涓鑸潵璁插簲璇ヤ笉浼氭姤閿 3. 搴旇涓嶇敤鎴戣瑙e浣曚娇鐢ㄥ惂 @@ -34,5 +62,5 @@ - 鏈」鐩強鑷堪鏂囦欢鏈缁堣В閲婃潈褰扻huOffice鎵鏈夈
-2022.10.15 10:03
+2022.11.05 15:13
Session Hu diff --git a/Script.vbs b/Script.vbs deleted file mode 100644 index 55a2f6c..0000000 --- a/Script.vbs +++ /dev/null @@ -1,8 +0,0 @@ -h = InputBox("请输入身高,单位随意") -If h < 10 Then - r = h*100 - MsgBox r ,, "身高(cm)" -Else - r = h/100 - MsgBox r ,, "身高(m)" -End If \ No newline at end of file diff --git a/icon.ico b/icon.ico new file mode 100644 index 0000000..a1fb976 Binary files /dev/null and b/icon.ico differ diff --git a/icon16.ico b/icon16.ico new file mode 100644 index 0000000..2aeb634 Binary files /dev/null and b/icon16.ico differ diff --git "a/\350\272\253\351\253\230\350\256\241\347\256\227\345\231\250.vbp" "b/\350\272\253\351\253\230\350\256\241\347\256\227\345\231\250.vbp" index 3e5081a..db16875 100644 --- "a/\350\272\253\351\253\230\350\256\241\347\256\227\345\231\250.vbp" +++ "b/\350\272\253\351\253\230\350\256\241\347\256\227\345\231\250.vbp" @@ -1,13 +1,13 @@ Type=Exe Form=Form1.frm -Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\Windows\SysWOW64\stdole2.tlb#OLE Automation +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\Windows\SysWOW64\stdole2.tlb#OLE Automation IconForm="Form1" Startup="Form1" HelpFile="" Title="身高计算器" ExeName32="身高计算器.exe" Command32="" -Name="工程1" +Name="身高计算器" HelpContextID="0" CompatibleMode="0" MajorVer=1