pexam6_4.frm
来自「深圳大学的vb上机与教学的课件」· FRM 代码 · 共 99 行
FRM
99 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 1965
ClientLeft = 60
ClientTop = 345
ClientWidth = 4230
LinkTopic = "Form1"
ScaleHeight = 1965
ScaleWidth = 4230
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "计算"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
TabIndex = 2
Top = 1080
Width = 1335
End
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Left = 1680
TabIndex = 1
Top = 240
Width = 2175
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1680
TabIndex = 3
Top = 1080
Width = 2175
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请输入N:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 240
TabIndex = 0
Top = 360
Width = 1500
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()
Dim I, N, S As Integer
N = Val(Text1.Text)
I = 0
S = 0
While S <= N
I = I + 1
S = S + I * I
Wend
Label2.Caption = S
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?