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

📄 form1.frm

📁 本文件包含200个visual baisc实例
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         BackColor       =   &H00C0C0C0&
         Caption         =   "8402"
         Height          =   870
         Index           =   21
         Left            =   135
         Style           =   1  'Graphical
         TabIndex        =   7
         Top             =   3615
         Width           =   1080
      End
      Begin VB.CommandButton Command1 
         BackColor       =   &H00C0C0C0&
         Caption         =   "8403"
         Height          =   870
         Index           =   22
         Left            =   1200
         Style           =   1  'Graphical
         TabIndex        =   6
         Top             =   3615
         Width           =   1080
      End
      Begin VB.CommandButton Command1 
         BackColor       =   &H00C0C0C0&
         Caption         =   "8404"
         Height          =   870
         Index           =   23
         Left            =   2265
         Style           =   1  'Graphical
         TabIndex        =   5
         Top             =   3615
         Width           =   1080
      End
      Begin VB.CommandButton Command1 
         BackColor       =   &H00C0C0C0&
         Caption         =   "8406"
         Height          =   870
         Index           =   24
         Left            =   3330
         Style           =   1  'Graphical
         TabIndex        =   4
         Top             =   3615
         Width           =   1080
      End
      Begin VB.CommandButton Command1 
         BackColor       =   &H00C0C0C0&
         Caption         =   "8408"
         Height          =   870
         Index           =   25
         Left            =   4395
         Style           =   1  'Graphical
         TabIndex        =   3
         Top             =   3615
         Width           =   1080
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "注释"
      Height          =   840
      Left            =   60
      TabIndex        =   0
      Top             =   4560
      Width           =   7440
      Begin VB.Label Label1 
         ForeColor       =   &H000000FF&
         Height          =   315
         Left            =   5520
         TabIndex        =   1
         Top             =   270
         Width           =   765
      End
      Begin VB.Label Label4 
         ForeColor       =   &H000000FF&
         Height          =   285
         Left            =   705
         TabIndex        =   28
         Top             =   330
         Width           =   780
      End
      Begin VB.Label Label5 
         ForeColor       =   &H000000FF&
         Height          =   285
         Left            =   2130
         TabIndex        =   29
         Top             =   345
         Width           =   705
      End
      Begin VB.Label Label7 
         ForeColor       =   &H000000FF&
         Height          =   285
         Left            =   3525
         TabIndex        =   30
         Top             =   330
         Width           =   915
      End
      Begin VB.Label Label11 
         Caption         =   "房间使用率:"
         ForeColor       =   &H00FF0000&
         Height          =   270
         Left            =   4500
         TabIndex        =   34
         Top             =   330
         Width           =   1095
      End
      Begin VB.Label Label10 
         Caption         =   "空闲:"
         ForeColor       =   &H00FF0000&
         Height          =   270
         Left            =   1530
         TabIndex        =   33
         Top             =   330
         Width           =   600
      End
      Begin VB.Label Label9 
         Caption         =   "使用:"
         ForeColor       =   &H00FF0000&
         Height          =   270
         Left            =   75
         TabIndex        =   32
         Top             =   330
         Width           =   600
      End
      Begin VB.Label Label8 
         Caption         =   "维修:"
         ForeColor       =   &H00FF0000&
         Height          =   270
         Left            =   2910
         TabIndex        =   31
         Top             =   330
         Width           =   600
      End
   End
   Begin VB.Image Image1 
      Height          =   480
      Left            =   6585
      Top             =   2385
      Width           =   480
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "入住"
      ForeColor       =   &H000040C0&
      Height          =   390
      Left            =   7080
      TabIndex        =   38
      Top             =   2460
      Width           =   510
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "空闲"
      ForeColor       =   &H000040C0&
      Height          =   390
      Left            =   7065
      TabIndex        =   37
      Top             =   3135
      Width           =   510
   End
   Begin VB.Label Label6 
      BackStyle       =   0  'Transparent
      Caption         =   "维修"
      ForeColor       =   &H000040C0&
      Height          =   390
      Left            =   7020
      TabIndex        =   36
      Top             =   3795
      Width           =   510
   End
   Begin VB.Image Image2 
      Height          =   360
      Left            =   6555
      Stretch         =   -1  'True
      Top             =   3705
      Width           =   345
   End
   Begin VB.Shape Shape1 
      Height          =   345
      Left            =   6555
      Top             =   3060
      Width           =   375
   End
   Begin VB.Label Label12 
      BackStyle       =   0  'Transparent
      Caption         =   "房态查看"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   36
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3270
      Left            =   30
      TabIndex        =   35
      Top             =   630
      Width           =   855
   End
End
Attribute VB_Name = "form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Activate()
  Dim i As Integer
  Dim mydb1 As Database
  Dim myrs1 As Recordset
  Dim myrs2 As Recordset
  Dim myrs3 As Recordset
  Dim criteria As String
  Set mydb1 = Workspaces(0).OpenDatabase(App.Path & "\kfgl.mdb")  ' 定义数据环境
  Set myrs1 = mydb1.OpenRecordset("kf", dbOpenSnapshot)       '定义数据表
  '入住房间查询
  SQL = "select * from kf where kf.房态 like " + Chr(34) + "入住" + Chr(34) + ""
  Set myrs2 = mydb1.OpenRecordset(SQL)
  '维修房间查询
  SQL = "select * from kf where kf.房态 like " + Chr(34) + "维修" + Chr(34) + ""
  Set myrs3 = mydb1.OpenRecordset(SQL)
  For i = 1 To 25             '房态显示
      criteria = "房间号 ='" & Command1(i).Caption & "'"
      myrs1.FindFirst criteria
      If myrs1.NoMatch Then
       Else
         If myrs1.Fields("房态") = "空房" Then Command1(i).Picture = LoadPicture("")  '空房
         If myrs1.Fields("房态") = "入住" Then Command1(i).Picture = LoadPicture(App.Path & "\rz.ico")
         If myrs1.Fields("房态") = "维修" Then Command1(i).Picture = LoadPicture(App.Path & "\wx.ico")
      End If
  Next i
  If Not myrs2.EOF Then myrs2.MoveLast
  If Not myrs3.EOF Then myrs3.MoveLast
  Label4.Caption = myrs2.RecordCount        '客房入住数
  Label7.Caption = myrs3.RecordCount        '客房维修数
  Label5.Caption = 25 - Val(Label7.Caption) - Val(Label4.Caption)     '客房空闲数
  Label1.Caption = Val(Label4.Caption) / 25 * 100 & "%"            '客房使用率
End Sub
Private Sub Command2_Click()
  End
End Sub

⌨️ 快捷键说明

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