⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 vb 的例子
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "计算阶乘"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox txtInput 
      Height          =   495
      Left            =   600
      TabIndex        =   2
      Text            =   "Text1"
      Top             =   240
      Width           =   2295
   End
   Begin VB.TextBox txtResult 
      Height          =   495
      Left            =   600
      TabIndex        =   1
      Text            =   "Text2"
      Top             =   960
      Width           =   2295
   End
   Begin VB.CommandButton cmdFactor 
      Caption         =   "计算"
      Height          =   375
      Left            =   2520
      TabIndex        =   0
      Top             =   1920
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "n!="
      Height          =   255
      Left            =   120
      TabIndex        =   4
      Top             =   1080
      Width           =   495
   End
   Begin VB.Label Label1 
      Caption         =   "n="
      Height          =   255
      Left            =   120
      TabIndex        =   3
      Top             =   360
      Width           =   495
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdFactor_Click()
     Dim int1 As Integer
     Dim intInput As Integer
     Dim lngResult As Long
     intInput = CInt(txtInput.Text)
     If intInput <= 0 Or intInput > 170 Then
           txtResult.Text = "请输入小于170的正整数!"
           Exit Sub                                 ' 结束过程
     End If
     int1 = 1
     lngAmount = 1                                  ' 注意赋初值为1
     Do Until int1 >= intInput + 1
          lngAmount = lngAmount * int1
          int1 = int1 + 1
     Loop
     txtResult.Text = lngAmount
End Sub

Private Sub Form_Load()

End Sub

Private Sub Label1_Click()

End Sub

⌨️ 快捷键说明

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