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

📄 form0406.frm

📁 VB实验教程源码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "计费汽油"
   ClientHeight    =   4125
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4140
   LinkTopic       =   "Form1"
   ScaleHeight     =   4125
   ScaleWidth      =   4140
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   495
      Left            =   2400
      TabIndex        =   9
      Top             =   1080
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      Height          =   495
      Left            =   2280
      TabIndex        =   8
      Top             =   3480
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "计算"
      Height          =   495
      Left            =   480
      TabIndex        =   7
      Top             =   3480
      Width           =   1095
   End
   Begin VB.Frame Frame1 
      Caption         =   "汽油种类"
      Height          =   1695
      Left            =   240
      TabIndex        =   1
      Top             =   240
      Width           =   1935
      Begin VB.OptionButton Option3 
         Caption         =   "97号汽油"
         Height          =   375
         Left            =   120
         TabIndex        =   6
         Top             =   1200
         Width           =   1335
      End
      Begin VB.OptionButton Option2 
         Caption         =   "93号汽油"
         Height          =   255
         Left            =   120
         TabIndex        =   3
         Top             =   840
         Value           =   -1  'True
         Width           =   1215
      End
      Begin VB.OptionButton Option1 
         Caption         =   "90号汽油"
         Height          =   375
         Left            =   120
         TabIndex        =   2
         Top             =   360
         Width           =   1455
      End
   End
   Begin VB.Label Label1 
      Caption         =   "数量:(升)"
      Height          =   375
      Left            =   2400
      TabIndex        =   5
      Top             =   360
      Width           =   1215
   End
   Begin VB.Label Label3 
      Height          =   375
      Left            =   240
      TabIndex        =   4
      Top             =   2760
      Width           =   3255
   End
   Begin VB.Label Label2 
      Caption         =   "93号汽油3.40升/元。"
      Height          =   375
      Left            =   240
      TabIndex        =   0
      Top             =   2160
      Width           =   3135
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
'单击计算按钮
    Dim Prize As Integer
    If Option1.Value = True Then
        Label3.Caption = "总价格为:" & 2.9 * Text1 & "元"
    ElseIf Option2.Value Then
        Label3.Caption = "总价格为:" & 3.4 * Text1 & "元"
    Else
        Label3.Caption = "总价格为:" & 3.6 * Text1 & "元"
    End If
End Sub

Private Sub Command2_Click()
'单击退出按钮
    End
End Sub

Private Sub Option1_Click()
'单击90号汽油
    Label2.Caption = "90号汽油单价2.90升/元"
End Sub

Private Sub Option2_Click()
'单击93号汽油
    Label2.Caption = "93号汽油单价3.40升/元"
End Sub

Private Sub Option3_Click()
'单击97号汽油
    Label2.Caption = "97号汽油单价3.60升/元"
End Sub

⌨️ 快捷键说明

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