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

📄 frmminimum.frm

📁 Visual Basic 6 大学教程的代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmMinimum 
   Caption         =   "Fig. 6.5: Minimum program"
   ClientHeight    =   3825
   ClientLeft      =   2850
   ClientTop       =   1575
   ClientWidth     =   4245
   BeginProperty Font 
      Name            =   "MS Sans Serif"
      Size            =   8.25
      Charset         =   0
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   ForeColor       =   &H80000008&
   LinkTopic       =   "Form1"
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   3825
   ScaleWidth      =   4245
   Begin VB.CommandButton cmdSmallest 
      BackColor       =   &H80000005&
      Caption         =   "Smallest"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   1335
      TabIndex        =   3
      Top             =   3030
      Width           =   1695
   End
   Begin VB.TextBox txtThree 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      Left            =   3000
      TabIndex        =   2
      Top             =   1455
      Width           =   972
   End
   Begin VB.TextBox txtTwo 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      Left            =   3000
      TabIndex        =   1
      Top             =   840
      Width           =   972
   End
   Begin VB.TextBox txtOne 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   420
      Left            =   3000
      TabIndex        =   0
      Top             =   255
      Width           =   972
   End
   Begin VB.Label lblSmallest 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   195
      TabIndex        =   7
      Top             =   2175
      Width           =   3855
   End
   Begin VB.Label lblThree 
      Caption         =   "Enter third value:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   6
      Top             =   1440
      Width           =   2655
   End
   Begin VB.Label lblTwo 
      Caption         =   "Enter second value:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   5
      Top             =   840
      Width           =   2655
   End
   Begin VB.Label lblOne 
      Caption         =   "Enter first value:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   240
      TabIndex        =   4
      Top             =   240
      Width           =   2652
   End
End
Attribute VB_Name = "frmMinimum"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Fig. 6.5
' Program finds the minimum of three numbers input
Option Explicit     ' General declaration

Private Sub cmdSmallest_Click()
   Dim value1 As Long, value2 As Long, value3 As Long

   value1 = txtOne.Text
   value2 = txtTwo.Text
   value3 = txtThree.Text
   
   Call Minimum(value1, value2, value3)
End Sub

Private Sub Minimum(min As Long, y As Long, z As Long)
   
   If y < min Then
      min = y
   End If
   
   If z < min Then
      min = z
   End If

   lblSmallest.Caption = "Smallest value is " & min
End Sub

⌨️ 快捷键说明

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