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

📄 级数和的函数过程.frm

📁 vb 程序基础设计与编程对初学者会有很大帮助
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "求级数和的函数过程"
   ClientHeight    =   2790
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4515
   LinkTopic       =   "Form1"
   ScaleHeight     =   2790
   ScaleWidth      =   4515
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "清除"
      Height          =   375
      Left            =   3120
      TabIndex        =   7
      Top             =   1560
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "计算"
      Height          =   375
      Left            =   960
      TabIndex        =   4
      Top             =   1560
      Width           =   855
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   1800
      TabIndex        =   3
      Top             =   960
      Width           =   1335
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1800
      TabIndex        =   1
      Top             =   240
      Width           =   735
   End
   Begin VB.Label Label4 
      BorderStyle     =   1  'Fixed Single
      Height          =   375
      Left            =   1800
      TabIndex        =   6
      Top             =   2160
      Width           =   2175
   End
   Begin VB.Label Label3 
      Caption         =   "计算结果"
      Height          =   255
      Left            =   480
      TabIndex        =   5
      Top             =   2280
      Width           =   855
   End
   Begin VB.Label Label2 
      Caption         =   "输入计算精度eps"
      Height          =   375
      Left            =   120
      TabIndex        =   2
      Top             =   960
      Width           =   1575
   End
   Begin VB.Label Label1 
      Caption         =   "输入x的值"
      Height          =   375
      Left            =   480
      TabIndex        =   0
      Top             =   360
      Width           =   975
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Function pro2(x!, eps#) As Double
  Dim sum#, i%, t#
  sum = 0
  i = 1
  t = x
  Do While (Abs(t) >= eps)
    sum = sum + t
    i = i + 1
    t = t * x / i
  Loop
  pro2 = sum
End Function

Private Sub Command1_Click()
  Dim y!, e#
  y = Text1.Text
  e = Text2.Text
  Label4.Caption = pro2(y, e)
End Sub

Private Sub Command2_Click()
  Text1.Text = ""
  Text2.Text = ""
  Label4.Caption = ""
End Sub

⌨️ 快捷键说明

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