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

📄 ct_cpcx.frm

📁 一个简单的酒店管理系统 用VB.net+SQL2000实现
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         TabIndex        =   7
         Top             =   225
         Width           =   825
      End
   End
   Begin VB.CommandButton CMD_EXIT 
      Caption         =   "退 出(Esc)"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   510
      Left            =   10140
      TabIndex        =   4
      Top             =   8280
      Width           =   1575
   End
   Begin VB.Label frm_msg 
      Alignment       =   1  'Right Justify
      ForeColor       =   &H00C00000&
      Height          =   330
      Left            =   5895
      TabIndex        =   13
      Top             =   180
      Visible         =   0   'False
      Width           =   5685
   End
   Begin VB.Label Label1 
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   18
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   180
      TabIndex        =   5
      Top             =   120
      Width           =   11475
   End
End
Attribute VB_Name = "ct_cpcx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim i As Integer
Dim key_index As Integer  '表示当前功能键的代码
Dim flex_rec As Recordset '

Dim t_funcNo As String    '0:增加记录  1:修改记录

Dim t_bt As String       '存储列表显示的表头
Dim t_fields As Variant  '存储列表显示的字段名
Dim t_fdxs As Variant    '显示列是否有特殊处理    0 无, 1 有
Dim t_fdcounts As Integer   '表示列表所显示的字段的个数

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.02.25
'*  修改日期 : 1999.02.25
'**************************************************************************************************
Private Sub button_refresh(t_ft As Boolean)
    cmd_func(4).Enabled = t_ft
    cmd_func(5).Enabled = t_ft
    
    If flex_rec.RecordCount <> 0 Then
        cmd_func(3).Enabled = t_ft
    Else
        cmd_func(3).Enabled = False
    End If
    
    ct_cpcx.KeyPreview = t_ft
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.02.25
'*  修改日期 : 1999.02.25
'**************************************************************************************************
Private Sub flex_refresh()
    Call Flex_full(gd1, t_bt, flex_rec, t_fields, t_fdcounts - 1, t_fdxs)
    lb_jls.Caption = gd1.Rows - 1
    
    Call button_refresh(True)
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.02.25
'*  修改日期 : 1999.02.25
'**************************************************************************************************
Sub MAIN(t_gnmc As String)
   Label1.Caption = t_gnmc
   JZ_USER = SYS_USER + Space(1) + SYS_NAME
   JZ_JRSJ2 = Time()
   JZ_DQSJ2 = Time()
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.02.25
'*  修改日期 : 1999.02.25
'**************************************************************************************************
Private Sub CMD_EXIT_Click()
    flex_rec.Close
    Unload Me
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.02.25
'*  修改日期 : 1999.02.25
'**************************************************************************************************
Private Sub cmd_func_Click(Index As Integer)
    
    frm_msg.Visible = False
    frm_msg.Caption = ""
    
    Select Case Index
    Case 3  '打印

    Case 4  '筛选
            fm_cx.Visible = True
            tx_bha.SetFocus
    Case 5  '刷新
            Call flex_refresh
            gd1.SetFocus
    End Select

End Sub

'**************************************************************************************************
Private Sub Form_Activate()
    gd1.SetFocus
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.02.25
'*  修改日期 : 1999.02.25
'**************************************************************************************************
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    key_index = 100
    frm_msg.Caption = ""
    frm_msg.Visible = False
    
    Select Case KeyCode
    Case vbKeyF5
            key_index = 3   '打印
    Case vbKeyF6
            key_index = 4   '筛选
    Case vbKeyF9
            key_index = 5   '刷新
    Case vbKeyEscape
            key_index = 101 '退出
    End Select
    
    If key_index <> 100 Then
        If key_index = 101 Then
            Call CMD_EXIT_Click
        Else
            If cmd_func(key_index).Enabled Then
                Call cmd_func_Click(key_index)
            End If
        End If
    End If
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.02.25
'*  修改日期 : 1999.02.25
'**************************************************************************************************
Private Sub Form_Load()

    frm_msg.Visible = False
    frm_msg.Caption = ""

    ct_cpcx.KeyPreview = True
    
    fm_cx.Visible = False
    tx_bha.Text = ""
    tx_bhb.Text = ""
    
    Set flex_rec = PUB_data.OpenRecordset("SELECT * FROM " & SYS_GWDM & "_MENU ORDER BY BHA", 4, 0, 2)
    If Not flex_rec.BOF Then
        flex_rec.MoveLast
    End If

    t_fields = Array("BHA", "BHB", "ZWMC", "YWMC", "JLDW", "DJ", "LBDMA", "FSRQ", "FSSJ", "CZY") '设置显示字段
    t_fdxs = Array(0, 0, 0, 0, 0, 2, 0, 0, 0, 0) '设置显示字段
    t_bt = "^菜牌编号  |<简  拼  |<中文名称             |<英文名称           |^计量单位|>单  价      |^类别|^登记日期    |^输入时间  |^操作员"   '设置显示表头格式
    t_fdcounts = 10
    
    Call flex_refresh
    
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.02.25
'*  修改日期 : 1999.02.25
'**************************************************************************************************
Private Sub gd1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then
        cmd_func(0).SetFocus
    End If
End Sub


'**************************************************************************************************
Private Sub tx_bha_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then
        tx_bhb.SetFocus
    End If
End Sub

Private Sub tx_bhb_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then
        gd1.SetFocus
    End If
End Sub

'**************************************************************************************************
Private Sub tx_bhb_LostFocus()
    Dim temp_sql As String
    If Trim(tx_bha.Text) = "" And Trim(tx_bhb.Text) = "" Then
        temp_sql = "SELECT * FROM " & SYS_GWDM & "_MENU "
    End If
    If Trim(tx_bha.Text) = "" And Trim(tx_bhb.Text) <> "" Then
        temp_sql = "SELECT * FROM " & SYS_GWDM & "_MENU WHERE LEFT(TRIM(BHB)," & Len(Trim(tx_bhb.Text)) & ")='" & Trim(tx_bhb.Text) & "'"
    End If
    If Trim(tx_bha.Text) <> "" And Trim(tx_bhb.Text) = "" Then
        temp_sql = "SELECT * FROM " & SYS_GWDM & "_MENU WHERE LEFT(TRIM(BHA)," & Len(Trim(tx_bha.Text)) & ")='" & Trim(tx_bha.Text) & "'"
    End If
    If Trim(tx_bha.Text) <> "" And Trim(tx_bhb.Text) <> "" Then
        temp_sql = "SELECT * FROM " & SYS_GWDM & "_MENU WHERE LEFT(TRIM(BHA)," & Len(Trim(tx_bha.Text)) & ")='" & Trim(tx_bha.Text) & "' AND LEFT(TRIM(BHB)," & Len(Trim(tx_bhb.Text)) & ")='" & Trim(tx_bhb.Text) & "'"
    End If
    
    Set flex_rec = PUB_data.OpenRecordset(temp_sql & " ORDER BY BHA", 4, 0, 2)
    If Not flex_rec.BOF Then
        flex_rec.MoveLast
    End If
    Call flex_refresh
    fm_cx.Visible = False
    gd1.SetFocus
End Sub

'**************************************************************************************************
Private Sub XT_Timer_Timer()
    JZ_DQSJ2.Caption = Time()
End Sub

⌨️ 快捷键说明

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