5—1.frm

来自「本教材为“第2章”、“第4章”、“第7章”、“第8章”、“第10章”和“第12章」· FRM 代码 · 共 66 行

FRM
66
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   4860
   ClientLeft      =   60
   ClientTop       =   405
   ClientWidth     =   5115
   LinkTopic       =   "Form1"
   ScaleHeight     =   4860
   ScaleWidth      =   5115
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2535
      Left            =   480
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   1
      Top             =   840
      Width           =   1455
   End
   Begin VB.CommandButton Command1 
      Caption         =   "生成并出入"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   18
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   975
      Left            =   2520
      TabIndex        =   0
      Top             =   1320
      Width           =   2175
   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 a(1 To 20) As Integer, i As Integer, sum As Integer
sum = 0: Text1.Text = ""
Randomize
For i = 1 To 20
a(i) = Int(Rnd * 100) + 1
If a(i) > 50 Then
Text1.Text = Text1.Text & a(i) & vbCrLf
sum = sum + a(i)
End If
Next i
Debug.Print "Sum="; sum
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?