📄 form0603.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "交换数据"
ClientHeight = 3330
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3330
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Caption = "交换结果"
Height = 1695
Left = 480
TabIndex = 6
Top = 720
Width = 3855
Begin VB.TextBox Text6
Height = 375
Left = 2760
TabIndex = 14
Top = 960
Width = 855
End
Begin VB.TextBox Text5
Height = 375
Left = 960
TabIndex = 12
Top = 960
Width = 855
End
Begin VB.TextBox Text4
Height = 375
Left = 2760
TabIndex = 10
Top = 360
Width = 855
End
Begin VB.TextBox Text3
Height = 375
Left = 960
TabIndex = 8
Top = 360
Width = 855
End
Begin VB.Label Label6
Caption = "y ="
Height = 375
Left = 2160
TabIndex = 13
Top = 960
Width = 615
End
Begin VB.Label Label5
Caption = "x ="
Height = 375
Left = 360
TabIndex = 11
Top = 960
Width = 495
End
Begin VB.Label Label4
Caption = "b ="
Height = 375
Left = 2160
TabIndex = 9
Top = 360
Width = 495
End
Begin VB.Label Label3
Caption = "a ="
Height = 375
Left = 360
TabIndex = 7
Top = 360
Width = 375
End
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 495
Left = 2760
TabIndex = 5
Top = 2640
Width = 975
End
Begin VB.CommandButton Command1
Caption = "交换"
Height = 495
Left = 840
TabIndex = 4
Top = 2640
Width = 975
End
Begin VB.TextBox Text2
Height = 375
Left = 3240
TabIndex = 1
Top = 240
Width = 855
End
Begin VB.TextBox Text1
Height = 375
Left = 1320
TabIndex = 0
Top = 240
Width = 855
End
Begin VB.Label Label2
Caption = "b ="
Height = 375
Left = 2640
TabIndex = 3
Top = 240
Width = 495
End
Begin VB.Label Label1
Caption = "a ="
Height = 375
Left = 720
TabIndex = 2
Top = 240
Width = 495
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
'单击交换按钮
Dim a As Integer, b As Integer
a = Val(Text1.Text)
b = Val(Text2.Text)
Call Change(a, b)
Text3.Text = a
Text4.Text = b
End Sub
'Private Sub Change(ByRef x As Single, ByRef y As Single)
Private Sub Change(ByVal x As Single, ByVal y As Single)
'交换数据子过程
Dim z As Single
z = x
x = y
y = z
Text5.Text = x
Text6.Text = y
End Sub
Private Sub Command2_Click()
'单击退出按钮
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -