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

📄 frmdoorperiod.frm

📁 依时利 EastRiver IC卡考勤机写卡程 VB
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmDoorperiod 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "时段编辑"
   ClientHeight    =   3135
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6240
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3135
   ScaleWidth      =   6240
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消(&C)"
      Height          =   375
      Left            =   4920
      TabIndex        =   23
      Top             =   2640
      Width           =   1095
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "确定(&O)"
      Height          =   375
      Left            =   3720
      TabIndex        =   22
      Top             =   2640
      Width           =   1095
   End
   Begin VB.Frame fraWeek 
      Caption         =   "有效日期"
      Height          =   1140
      Left            =   105
      TabIndex        =   10
      Top             =   1320
      Width           =   6015
      Begin VB.CheckBox ckW6 
         Caption         =   "周六"
         Height          =   255
         Left            =   5160
         TabIndex        =   21
         Top             =   435
         Value           =   1  'Checked
         Width           =   705
      End
      Begin VB.CheckBox ckW5 
         Caption         =   "周五"
         Height          =   255
         Left            =   4350
         TabIndex        =   20
         Top             =   435
         Value           =   1  'Checked
         Width           =   720
      End
      Begin VB.CheckBox ckW4 
         Caption         =   "周四"
         Height          =   255
         Left            =   3495
         TabIndex        =   19
         Top             =   435
         Value           =   1  'Checked
         Width           =   825
      End
      Begin VB.CheckBox ckW3 
         Caption         =   "周三"
         Height          =   255
         Left            =   2670
         TabIndex        =   18
         Top             =   435
         Value           =   1  'Checked
         Width           =   720
      End
      Begin VB.CheckBox ckW2 
         Caption         =   "周二"
         Height          =   255
         Left            =   1815
         TabIndex        =   17
         Top             =   435
         Value           =   1  'Checked
         Width           =   795
      End
      Begin VB.CheckBox ckW1 
         Caption         =   "周一"
         Height          =   255
         Left            =   990
         TabIndex        =   16
         Top             =   435
         Value           =   1  'Checked
         Width           =   810
      End
      Begin VB.CheckBox ckW7 
         Caption         =   "周日"
         Height          =   255
         Left            =   210
         TabIndex        =   15
         Top             =   435
         Value           =   1  'Checked
         Width           =   690
      End
   End
   Begin VB.Frame fraDoor 
      Caption         =   "有效门"
      Height          =   1095
      Left            =   120
      TabIndex        =   9
      Top             =   1320
      Width           =   6015
      Begin VB.CheckBox ckD4 
         Caption         =   "四号门"
         Height          =   255
         Left            =   4560
         TabIndex        =   14
         Top             =   480
         Value           =   1  'Checked
         Width           =   855
      End
      Begin VB.CheckBox ckD3 
         Caption         =   "三号门"
         Height          =   255
         Left            =   3240
         TabIndex        =   13
         Top             =   480
         Value           =   1  'Checked
         Width           =   975
      End
      Begin VB.CheckBox ckD2 
         Caption         =   "二号门"
         Height          =   255
         Left            =   1800
         TabIndex        =   12
         Top             =   480
         Value           =   1  'Checked
         Width           =   975
      End
      Begin VB.CheckBox ckD1 
         Caption         =   "一号门"
         Height          =   255
         Left            =   360
         TabIndex        =   11
         Top             =   480
         Value           =   1  'Checked
         Width           =   1095
      End
   End
   Begin VB.Frame fraState 
      Caption         =   "状态时间( 小时:分钟)"
      Height          =   1035
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   6015
      Begin VB.ComboBox cbState 
         Height          =   315
         ItemData        =   "frmDoorperiod.frx":0000
         Left            =   3240
         List            =   "frmDoorperiod.frx":0016
         Style           =   2  'Dropdown List
         TabIndex        =   7
         Top             =   435
         Width           =   2415
      End
      Begin VB.ComboBox cbLevel 
         Height          =   315
         ItemData        =   "frmDoorperiod.frx":0052
         Left            =   4890
         List            =   "frmDoorperiod.frx":0086
         Style           =   2  'Dropdown List
         TabIndex        =   6
         Top             =   420
         Width           =   855
      End
      Begin VB.TextBox txtEnd 
         BeginProperty DataFormat 
            Type            =   1
            Format          =   "HH:mm"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   4
         EndProperty
         Height          =   330
         Left            =   3120
         MaxLength       =   5
         TabIndex        =   4
         Text            =   "24:00"
         Top             =   420
         Width           =   1065
      End
      Begin VB.TextBox txtStart 
         BeginProperty DataFormat 
            Type            =   1
            Format          =   "HH:mm"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   4
         EndProperty
         Height          =   315
         Left            =   945
         MaxLength       =   5
         TabIndex        =   2
         Text            =   "00:00"
         Top             =   450
         Width           =   1125
      End
      Begin VB.Label lbState 
         Caption         =   "状态"
         Height          =   255
         Left            =   2400
         TabIndex        =   8
         Top             =   480
         Width           =   495
      End
      Begin VB.Label lbLevel 
         Caption         =   "等级"
         Height          =   255
         Left            =   4440
         TabIndex        =   5
         Top             =   480
         Width           =   495
      End
      Begin VB.Label lbend 
         Caption         =   "结束时间"
         Height          =   255
         Left            =   2250
         TabIndex        =   3
         Top             =   480
         Width           =   855
      End
      Begin VB.Label lbstart 
         Caption         =   "开始时间"
         Height          =   255
         Left            =   120
         TabIndex        =   1
         Top             =   480
         Width           =   855
      End
   End
End
Attribute VB_Name = "frmDoorperiod"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public kind  As Integer
Public Doors As String
Public blAdd As Boolean

Private Sub cmdCancel_Click()
    Unload frmDoorperiod
End Sub

Private Sub cmdOk_Click()
    Dim i As Integer
    Dim ltmX As ListItem
    
    If txtStart.Text = "" Or txtEnd.Text = "" Or cbState.Text = "" Or cbLevel.Text = "" Then
        MsgBox "请输入或选择必需的信息.", vbInformation, "提示"
        Exit Sub
    End If
        Doors = ""
        If ckD1.Value = 1 Then
            Doors = Doors + "1"
        End If
        If ckD2.Value = 1 Then
            Doors = Doors + "2"
        End If
        If ckD3.Value = 1 Then
            Doors = Doors + "3"
        End If
        If ckD4.Value = 1 Then
            Doors = Doors + "4"
        End If
        
    If blAdd = False Then
        frmMain.lvDoorPeriods.SelectedItem.SubItems(2) = Doors
        Select Case kind
            Case 0
                frmMain.lvDoorPeriods.SelectedItem.Text = txtStart.Text
                frmMain.lvDoorPeriods.SelectedItem.SubItems(1) = cbState.Text
    '            frmMain.lvDoorPeriods.SelectedItem.SubItems(2) = Doors
            Case 1, 2, 4
                frmMain.lvDoorPeriods.SelectedItem.Text = txtStart.Text & "-" & txtEnd.Text
                frmMain.lvDoorPeriods.SelectedItem.SubItems(3) = cbLevel.Text
                If ckW7.Value = 1 Then
                    frmMain.lvDoorPeriods.SelectedItem.SubItems(4) = "*"
                Else
                    frmMain.lvDoorPeriods.SelectedItem.SubItems(4) = ""
                End If
                If ckW1.Value = 1 Then
                    frmMain.lvDoorPeriods.SelectedItem.SubItems(5) = "*"
                Else
                    frmMain.lvDoorPeriods.SelectedItem.SubItems(5) = ""
                End If
                If ckW2.Value = 1 Then
                    frmMain.lvDoorPeriods.SelectedItem.SubItems(6) = "*"
                Else
                    frmMain.lvDoorPeriods.SelectedItem.SubItems(6) = ""
                End If
                If ckW3.Value = 1 Then
                    frmMain.lvDoorPeriods.SelectedItem.SubItems(7) = "*"
                Else
                    frmMain.lvDoorPeriods.SelectedItem.SubItems(7) = ""
                End If
                If ckW4.Value = 1 Then
                    frmMain.lvDoorPeriods.SelectedItem.SubItems(8) = "*"
                Else
                    frmMain.lvDoorPeriods.SelectedItem.SubItems(8) = ""
                End If
                If ckW5.Value = 1 Then
                    frmMain.lvDoorPeriods.SelectedItem.SubItems(9) = "*"
                Else
                    frmMain.lvDoorPeriods.SelectedItem.SubItems(9) = ""
                End If
                If ckW6.Value = 1 Then
                    frmMain.lvDoorPeriods.SelectedItem.SubItems(10) = "*"
                Else
                    frmMain.lvDoorPeriods.SelectedItem.SubItems(10) = ""
                End If
        End Select
    Else
        Set ltmX = frmMain.lvDoorPeriods.ListItems.Add
        Select Case kind
            Case 0
                ltmX.Text = Format(txtStart.Text, "00:00")
                ltmX.SubItems(1) = cbState.Text
                ltmX.SubItems(2) = Doors
            Case 1, 2
                ltmX.Text = txtStart.Text & "-" & txtEnd.Text
                ltmX.SubItems(3) = cbLevel.Text
                If kind = 2 Then
                    If ckW7.Value = 1 Then
                        ltmX.SubItems(4) = "*"
                    Else
                        ltmX.SubItems(4) = " "
                    End If
                    If ckW1.Value = 1 Then
                        ltmX.SubItems(5) = "*"
                    Else
                        ltmX.SubItems(5) = " "
                    End If
                    If ckW2.Value = 1 Then
                        ltmX.SubItems(6) = "*"
                    Else
                        ltmX.SubItems(6) = " "
                    End If
                    If ckW3.Value = 1 Then
                        ltmX.SubItems(7) = "*"
                    Else
                        ltmX.SubItems(7) = " "
                    End If
                    If ckW4.Value = 1 Then
                        ltmX.SubItems(8) = "*"
                    Else
                        ltmX.SubItems(8) = " "
                    End If
                    If ckW5.Value = 1 Then
                        ltmX.SubItems(9) = "*"
                    Else
                        ltmX.SubItems(9) = " "
                    End If
                    If ckW6.Value = 1 Then
                        ltmX.SubItems(10) = "*"
                    Else
                        ltmX.SubItems(10) = " "
                    End If
                End If
            Case 4
                ltmX.Text = txtStart.Text & "-" & txtEnd.Text
                ltmX.SubItems(2) = Doors
        End Select
    End If
    Unload frmDoorperiod
End Sub

Private Sub Form_Load()
    Select Case kind
        Case 0
                lbend.Visible = False
                txtEnd.Visible = False
                lbLevel.Visible = False
                cbLevel.Visible = False
                fraWeek.Visible = False
        Case 1, 2, 4
                lbState.Visible = False
                cbState.Visible = False
                fraDoor.Visible = False
                If kind = 2 Then
                    fraWeek.Visible = False
                    cmdOk.Top = fraState.Top + fraState.Height + 200
                    cmdCancel.Top = cmdOk.Top
                    frmDoorperiod.Height = cmdOk.Top + cmdOk.Height + 500
                End If
                If kind = 4 Then
                    fraDoor.Visible = True
                    fraWeek.Visible = False
                    lbLevel.Visible = False
                    cbLevel.Visible = False
                End If
    End Select
    If cbState.Text = "" Then
        cbState.ListIndex = 0
    End If
    If cbLevel.Text = "" Then
        cbLevel.ListIndex = 0
    End If
    If blAdd <> True Then blAdd = False
End Sub

⌨️ 快捷键说明

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