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

📄 dlgyjs.frm

📁 本系统可用于医院和专业体检中心的健康体检管理
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{0B81E4A9-BE4E-4AEF-9272-33AB5B51C6FC}#1.0#0"; "XPControls.ocx"
Begin VB.Form dlgYJS 
   BackColor       =   &H80000018&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "饮酒史"
   ClientHeight    =   4935
   ClientLeft      =   2760
   ClientTop       =   3750
   ClientWidth     =   4650
   Icon            =   "dlgYJS.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4935
   ScaleWidth      =   4650
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.TextBox txtDescription 
      Height          =   1095
      Left            =   1530
      TabIndex        =   4
      Top             =   2355
      Width           =   2385
   End
   Begin VB.TextBox txtYJPL 
      Height          =   285
      Left            =   1530
      TabIndex        =   3
      Top             =   1935
      Width           =   645
   End
   Begin VB.TextBox txtBJ 
      Height          =   285
      Left            =   1530
      TabIndex        =   2
      Top             =   645
      Width           =   645
   End
   Begin VB.TextBox txtPJ 
      Height          =   285
      Left            =   1530
      TabIndex        =   1
      Top             =   1065
      Width           =   645
   End
   Begin VB.TextBox txtSJ 
      Height          =   285
      Left            =   1530
      TabIndex        =   0
      Top             =   1500
      Width           =   645
   End
   Begin XPControls.XPCommandButton cmdCancel 
      Height          =   375
      Left            =   2640
      TabIndex        =   5
      Top             =   4350
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   661
      Caption         =   "取消(&C)"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin XPControls.XPCommandButton cmdOK 
      Height          =   375
      Left            =   1080
      TabIndex        =   6
      Top             =   4350
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   661
      Caption         =   "确定(&O)"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin MSComCtl2.DTPicker dtpStop 
      Height          =   345
      Left            =   1530
      TabIndex        =   7
      Top             =   3600
      Width           =   1365
      _ExtentX        =   2408
      _ExtentY        =   609
      _Version        =   393216
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Format          =   23789569
      CurrentDate     =   38037
      MaxDate         =   73415
      MinDate         =   2
   End
   Begin MSComCtl2.DTPicker dtpBegin 
      Height          =   345
      Left            =   1530
      TabIndex        =   8
      Top             =   150
      Width           =   1365
      _ExtentX        =   2408
      _ExtentY        =   609
      _Version        =   393216
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Format          =   23789569
      CurrentDate     =   38037
      MaxDate         =   73415
      MinDate         =   2
   End
   Begin VB.Label Label5 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "戒断时间:"
      Height          =   225
      Left            =   390
      TabIndex        =   18
      Top             =   3690
      Width           =   1035
   End
   Begin VB.Label Label4 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "情况描述:"
      Height          =   225
      Left            =   390
      TabIndex        =   17
      Top             =   2340
      Width           =   1035
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "饮酒频率:"
      Height          =   225
      Left            =   390
      TabIndex        =   16
      Top             =   1950
      Width           =   1035
   End
   Begin VB.Label Label1 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "开始时间:"
      Height          =   225
      Left            =   390
      TabIndex        =   15
      Top             =   240
      Width           =   1035
   End
   Begin VB.Label Label6 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "白酒:"
      Height          =   225
      Left            =   390
      TabIndex        =   14
      Top             =   690
      Width           =   1035
   End
   Begin VB.Label Label7 
      BackStyle       =   0  'Transparent
      Caption         =   "克/天"
      Height          =   285
      Left            =   2250
      TabIndex        =   13
      Top             =   690
      Width           =   585
   End
   Begin VB.Label Label8 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "啤酒:"
      Height          =   225
      Left            =   390
      TabIndex        =   12
      Top             =   1140
      Width           =   1035
   End
   Begin VB.Label Label9 
      BackStyle       =   0  'Transparent
      Caption         =   "克/天"
      Height          =   225
      Left            =   2250
      TabIndex        =   11
      Top             =   1110
      Width           =   465
   End
   Begin VB.Label Label10 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "色酒:"
      Height          =   225
      Left            =   390
      TabIndex        =   10
      Top             =   1560
      Width           =   1035
   End
   Begin VB.Label Label11 
      BackStyle       =   0  'Transparent
      Caption         =   "克/天"
      Height          =   255
      Left            =   2250
      TabIndex        =   9
      Top             =   1530
      Width           =   585
   End
End
Attribute VB_Name = "dlgYJS"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit
Dim mblnOK As Boolean '用户单击了哪个按钮
Dim menuOperation As OperationType
Dim mstrRet As String

Private Sub cmdCancel_Click()
    mblnOK = False
    Unload Me
End Sub

Private Sub cmdOK_Click()
    '校验用户输入的合法性
    '开始时间
    If dtpBegin.Value > Date Then
        MsgBox "您输入的开始时间不符合实际情况,请重新输入!", vbInformation, "提示"
        dtpBegin.SetFocus
        Exit Sub
    End If
    
    '戒断时间
    If dtpStop.Value > Date Then
        MsgBox "您输入的戒断时间不符合实际情况,请重新输入!", vbInformation, "提示"
        dtpStop.SetFocus
        Exit Sub
    End If
    
    '开始时间是否在戒断时间前面
    If dtpBegin.Value > dtpStop.Value Then
        MsgBox "开始时间不应该比戒断时间迟!请重新输入!", vbInformation, "提示"
        dtpBegin.SetFocus
        Exit Sub
    End If
    
    '饮酒频率
    If Val(txtYJPL.Text) <= 0 Then
        MsgBox "饮酒频率应该是非负数!请重新输入!", vbInformation, "提示"
        txtYJPL.SetFocus
        Exit Sub
    End If
    
    '校验完毕
    mblnOK = True
    
    mstrRet = dtpBegin.Value & JoinSymbol _
            & txtBJ.Text & JoinSymbol _
            & txtPJ.Text & JoinSymbol _
            & txtSJ.Text & JoinSymbol _
            & txtYJPL.Text & JoinSymbol _
            & txtDescription.Text & JoinSymbol _
            & dtpStop.Value
    
    Unload Me
End Sub

Private Sub dtpBegin_KeyPress(KeyAscii As Integer)
    EnterToTab KeyAscii
End Sub

Private Sub dtpStop_KeyPress(KeyAscii As Integer)
    EnterToTab KeyAscii
End Sub

Private Sub txtBJ_KeyPress(KeyAscii As Integer)
    EnterToTab KeyAscii
End Sub

Private Sub txtBJ_LostFocus()
    txtBJ.Text = Val(txtBJ.Text)
End Sub

Private Sub txtPJ_KeyPress(KeyAscii As Integer)
    EnterToTab KeyAscii
End Sub

Private Sub txtPJ_LostFocus()
    txtPJ.Text = Val(txtPJ.Text)
End Sub

Private Sub txtSJ_KeyPress(KeyAscii As Integer)
    EnterToTab KeyAscii
End Sub

Private Sub txtSJ_LostFocus()
    txtSJ.Text = Val(txtSJ.Text)
End Sub

Private Sub txtYJPL_KeyPress(KeyAscii As Integer)
    EnterToTab KeyAscii
End Sub

Private Sub txtYJPL_LostFocus()
    txtYJPL.Text = Val(txtYJPL.Text)
End Sub

'被frmRegister调用的函数
Public Function ShowYJS(ByVal enuOperation As OperationType, _
        Optional ByVal strYJS As String) As String
On Error GoTo ErrMsg
    Dim Status
    Dim arrYJS
    
    menuOperation = enuOperation
    
    '判断是否更新
    If enuOperation = Modify Then
        arrYJS = Split(strYJS, JoinSymbol)
        
        dtpBegin.Value = arrYJS(0)
        txtBJ.Text = arrYJS(1)
        txtPJ.Text = arrYJS(2)
        txtSJ.Text = arrYJS(3)
        txtYJPL.Text = arrYJS(4)
        txtDescription.Text = arrYJS(5)
        dtpStop.Value = arrYJS(6)
    End If
    
    '显示窗体
    Me.Show vbModal
    
    '查看返回值
    If mblnOK = True Then
        ShowYJS = mstrRet
    End If
    
    Exit Function
ErrMsg:
    
End Function

⌨️ 快捷键说明

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