【VB开源代码栏目提醒】:本文主要为网学会员提供Ex5_5.frm,希望对需要Ex5_5.frm网友有所帮助,学习一下!
VERSION 5.00
Begin VB.Form Ex5_5
Caption = "Form1"
ClientHeight = 3870
ClientLeft = 60
ClientTop = 450
ClientWidth = 3990
LinkTopic = "Form1"
ScaleHeight = 3870
ScaleWidth = 3990
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text7
Height = 390
Left = 2400
TabIndex = 16
Top = 3120
Width = 1215
End
Begin VB.TextBox Text6
Height = 375
Left = 600
TabIndex = 14
Top = 3120
Width = 1215
End
Begin VB.TextBox Text5
Height = 375
Left = 2400
TabIndex = 12
Top = 2520
Width = 1215
End
Begin VB.TextBox Text4
Height = 375
Left = 600
TabIndex = 10
Top = 2520
Width = 1215
End
Begin VB.TextBox Text3
Height = 375
Left = 2400
TabIndex = 8
Top = 1920
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "计算"
Height = 375
Left = 1440
TabIndex = 6
Top = 1200
Width = 1095
End
Begin VB.TextBox Text2
Height = 375
Left = 2400
TabIndex = 4
Top = 600
Width = 1215
End
Begin VB.TextBox Text1
Height = 390
Left = 600
TabIndex = 1
Top = 600
Width = 1215
End
Begin VB.Label Label9
Caption = "b="
Height = 255
Left = 2040
TabIndex = 15
Top = 3240
Width = 255
End
Begin VB.Label Label8
Caption = "a="
Height = 255
Left = 240
TabIndex = 13
Top = 3240
Width = 255
End
Begin VB.Label Label7
Caption = "y="
Height = 255
Left = 2040
TabIndex = 11
Top = 2640
Width = 255
End
Begin VB.Label Label6
Caption = "x="
Height = 255
Left = 240
TabIndex = 9
Top = 2640
Width = 255
End
Begin VB.Label Label5
Caption = "较大数为"
Height = 255
Left = 360
TabIndex = 7
Top = 2040
Width = 975
End
Begin VB.Label Label4
Caption = "运行结果"
Height = 255
Left = 120
TabIndex = 5
Top = 1560
Width = 975
End
Begin VB.Label Label3
Caption = "b="
Height = 255
Left = 2040
TabIndex = 3
Top = 720
Width = 255
End
Begin VB.Label Label2
Caption = "a="
Height = 255
Left = 240
TabIndex = 2
Top = 720
Width = 255
End
Begin VB.Label Label1
Caption = "请输入两个数"
Height = 255
Left = 240
TabIndex = 0
Top = 240
Width = 1575
End
End
Attribute VB_Name = "Ex5_5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Function max(ByVal x As Integer, ByVal y As Integer)
Dim t As Integer
If x < y Then '比较x和y的大小
t = x: x = y: y = t '交换x和y的值
End If
max = x
Text4.Text = x '将形参的值显示TextBox控件上
Text5.Text = y
End Function
Private Sub Command1_Click()
Dim a As Integer, b As Integer '定义变量
a = Val(Text1.Text) '将text1和text2中的内容存储到a和b中
b = Val(Text2.Text)
Text3.Text = max(a, b) '比较a和b获得最大数
Text6.Text = a '显示实参内容
Text7.Text = b
End Sub
上一篇:
Ex5_4.frm
下一篇:
asp论文:浅论ASP在多媒体网页课件制作中的应用