pexam6_1.frm
来自「深圳大学的vb上机与教学的课件」· FRM 代码 · 共 115 行
FRM
115 行
VERSION 5.00
Begin VB.Form Form1
Caption = "求1+2+3+…+n的值"
ClientHeight = 2025
ClientLeft = 60
ClientTop = 345
ClientWidth = 3645
LinkTopic = "Form1"
ScaleHeight = 2025
ScaleWidth = 3645
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "计算(&C)"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 2
Top = 1320
Width = 1575
End
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 1920
TabIndex = 0
Top = 240
Width = 1455
End
Begin VB.Label Label3
Alignment = 1 'Right Justify
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1920
TabIndex = 4
Top = 720
Width = 1455
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "1+2+3+…+n="
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 120
TabIndex = 3
Top = 720
Width = 1800
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请输入n:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 360
TabIndex = 1
Top = 240
Width = 1245
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 N As Integer, I As Integer, Sum As Integer
N = Val(Text1.Text)
Sum = 0
For I = 1 To N
Sum = Sum + I
Next I
Label3.Caption = Sum
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?