⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 角度弧度换算.frm

📁 角度和弧度换算算法
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "角度弧度换算"
   ClientHeight    =   1815
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   2670
   LinkTopic       =   "Form1"
   ScaleHeight     =   1815
   ScaleWidth      =   2670
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "弧度->角度"
      Height          =   375
      Left            =   1440
      TabIndex        =   11
      Top             =   1320
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "角度->弧度"
      Height          =   375
      Left            =   120
      TabIndex        =   10
      Top             =   1320
      Width           =   1095
   End
   Begin VB.CommandButton Command3 
      Caption         =   "清零"
      Height          =   615
      Left            =   2040
      TabIndex        =   9
      Top             =   480
      Width           =   495
   End
   Begin VB.TextBox Text4 
      Height          =   285
      Left            =   720
      TabIndex        =   8
      Text            =   "0"
      Top             =   720
      Width           =   1215
   End
   Begin VB.TextBox Text3 
      Height          =   285
      Left            =   1920
      TabIndex        =   6
      Text            =   "0"
      Top             =   105
      Width           =   375
   End
   Begin VB.TextBox Text2 
      Height          =   285
      Left            =   1320
      TabIndex        =   4
      Text            =   "0"
      Top             =   105
      Width           =   375
   End
   Begin VB.TextBox Text1 
      Height          =   285
      Left            =   720
      TabIndex        =   2
      Text            =   "0"
      Top             =   105
      Width           =   375
   End
   Begin VB.Label Label5 
      Caption         =   "秒"
      Height          =   255
      Left            =   2280
      TabIndex        =   7
      Top             =   120
      Width           =   255
   End
   Begin VB.Label Label4 
      Caption         =   "分"
      Height          =   255
      Left            =   1680
      TabIndex        =   5
      Top             =   120
      Width           =   255
   End
   Begin VB.Label Label3 
      Caption         =   "度"
      Height          =   255
      Left            =   1080
      TabIndex        =   3
      Top             =   120
      Width           =   255
   End
   Begin VB.Label Label2 
      Caption         =   "弧度:"
      Height          =   255
      Left            =   240
      TabIndex        =   1
      Top             =   720
      Width           =   615
   End
   Begin VB.Label Label1 
      Caption         =   "角度:"
      Height          =   255
      Left            =   240
      TabIndex        =   0
      Top             =   120
      Width           =   615
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Const Pi = 3.14159265358979


Private Sub Command1_Click()
    a = (Text1.Text)        '若加上了Change事件,就需要用Val,因为有空文本出现,因此VB不知道+表示数字相加还是字符串连接
    b = Text2.Text
    c = Text3.Text
    
    d = a + b / 60 + c / 3600       '十进制度表示
    d = d * Pi / 180            '化为弧度
    
    Text4.Text = Format(d, "0.000000")

End Sub

Private Sub Command3_Click()
    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
End Sub

Private Sub Command2_Click()
    d = Text4.Text
    
    d = d * 180 / Pi            '化为十进制度
    a = Int(d)                  '获得度数
    d = (d - a) * 60
    b = Int(d)                  '获得分数
    d = (d - b) * 600           '秒数取小数点后一位
    c = Int(d) / 10#            '获得秒数
    
    Text1.Text = a
    Text2.Text = b
    Text3.Text = c

End Sub

'Private Sub Text1_Change()
'    a = Val(Text1.Text)
'    b = Val(Text2.Text)
'    c = Val(Text3.Text)
'
'    d = a + b / 60 + c / 3600
'    d = d * Pi / 180
'
'    Text4.Text = Format(d, "0.000000")
'End Sub
'

'Private Sub Text2_Change()
'    a = Val(Text1.Text)
'    b = Val(Text2.Text)
'    c = Val(Text3.Text)
'
'    d = a + b / 60 + c / 3600
'    d = d * Pi / 180
'
'    Text4.Text = Format(d, "0.000000")
'End Sub
'
'Private Sub Text3_Change()
'    a = Val(Text1.Text)
'    b = Val(Text2.Text)
'    c = Val(Text3.Text)
'
'    d = a + b / 60 + c / 3600
'    d = d * Pi / 180
'
'    Text4.Text = Format(d, "0.000000")
'End Sub
'

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -