例题4.2 时间秒数计算.frm

来自「蒋加伏主编VB程序设计第四版PPT及全部课本源码 北京邮电大学出版社 」· FRM 代码 · 共 88 行

FRM
88
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "例题4.2 时间秒数计算"
   ClientHeight    =   4305
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4275
   LinkTopic       =   "Form1"
   ScaleHeight     =   4305
   ScaleWidth      =   4275
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "计算"
      Height          =   495
      Left            =   1560
      TabIndex        =   7
      Top             =   2640
      Width           =   1215
   End
   Begin VB.TextBox Text3 
      Height          =   495
      Left            =   1789
      TabIndex        =   2
      Top             =   1840
      Width           =   1215
   End
   Begin VB.TextBox Text2 
      Height          =   495
      Left            =   1789
      TabIndex        =   1
      Top             =   1040
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      Height          =   495
      Left            =   1789
      TabIndex        =   0
      Top             =   240
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "时"
      Height          =   375
      Left            =   1076
      TabIndex        =   6
      Top             =   360
      Width           =   615
   End
   Begin VB.Label Label4 
      BorderStyle     =   1  'Fixed Single
      Height          =   495
      Left            =   840
      TabIndex        =   5
      Top             =   3360
      Width           =   2655
   End
   Begin VB.Label Label3 
      Caption         =   "秒"
      Height          =   375
      Left            =   1076
      TabIndex        =   4
      Top             =   1935
      Width           =   615
   End
   Begin VB.Label Label2 
      Caption         =   "分"
      Height          =   375
      Left            =   1076
      TabIndex        =   3
      Top             =   1140
      Width           =   615
   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 h, m, s, x
  h = Val(Text1.Text)
  m = Val(Text2.Text)
  s = Val(Text3.Text)
  x = h * 3600 + m * 60 + s
  Label4.Caption = "共有秒数:" & x
End Sub

⌨️ 快捷键说明

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