?? form0601_2.frm
字號:
VERSION 5.00
Begin VB.Form Form2
Caption = "計算三角形斜邊"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form2"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text3
Height = 495
Left = 1920
TabIndex = 6
Top = 1440
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "計算"
Height = 495
Left = 1680
TabIndex = 4
Top = 2280
Width = 1095
End
Begin VB.TextBox Text2
Height = 495
Left = 3360
TabIndex = 1
Top = 600
Width = 975
End
Begin VB.TextBox Text1
Height = 495
Left = 1200
TabIndex = 0
Top = 600
Width = 975
End
Begin VB.Label Label3
Caption = "斜邊 c ="
Height = 375
Left = 960
TabIndex = 5
Top = 1560
Width = 735
End
Begin VB.Label Label2
Caption = "b="
Height = 375
Left = 2760
TabIndex = 3
Top = 600
Width = 495
End
Begin VB.Label Label1
Caption = "a="
Height = 375
Left = 480
TabIndex = 2
Top = 600
Width = 495
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public Function Function1(ByVal a As Single, ByVal b As Single) As Single
'計算直角斜邊函數
Dim c As Single
c = Sqr(a ^ 2 + b ^ 2)
Function1 = c
End Function
Private Sub Command1_Click()
'計算斜邊
Dim a1 As Single, b1 As Single
a1 = Val(Text1.Text)
b1 = Val(Text2.Text)
Text3.Text = Function1(a1, b1)
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -