📄 dy_rqfw.frm
字号:
VERSION 5.00
Object = "{C932BA88-4374-101B-A56C-00AA003668DC}#1.1#0"; "MSMASK32.OCX"
Begin VB.Form dy_rqfw
ClientHeight = 1740
ClientLeft = 60
ClientTop = 60
ClientWidth = 4920
ControlBox = 0 'False
LinkTopic = "Form1"
LockControls = -1 'True
ScaleHeight = 1740
ScaleWidth = 4920
StartUpPosition = 3 'Windows Default
Begin VB.Frame Frame1
BackColor = &H80000018&
Caption = "日期范围"
Height = 1695
Left = 0
TabIndex = 2
Top = 0
Width = 4935
Begin MSMask.MaskEdBox m_jzrq
Height = 255
Left = 3360
TabIndex = 1
Top = 720
Width = 1215
_ExtentX = 2143
_ExtentY = 450
_Version = 327680
MaxLength = 10
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Mask = "####-##-##"
PromptChar = "_"
End
Begin MSMask.MaskEdBox m_qsrq
Height = 255
Left = 1080
TabIndex = 0
Top = 720
Width = 1215
_ExtentX = 2143
_ExtentY = 450
_Version = 327680
MaxLength = 10
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Mask = "####-##-##"
PromptChar = " "
End
Begin VB.Label MSG
AutoSize = -1 'True
BackColor = &H80000018&
ForeColor = &H00FF0000&
Height = 180
Left = 3480
TabIndex = 6
Top = 120
Width = 90
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H80000018&
Caption = "起始日期:"
ForeColor = &H00FF0000&
Height = 180
Left = 120
TabIndex = 4
Top = 720
Width = 810
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H80000018&
Caption = "截止日期:"
ForeColor = &H00FF0000&
Height = 180
Left = 2400
TabIndex = 3
Top = 720
Width = 810
End
End
Begin VB.Label Label3
AutoSize = -1 'True
BackColor = &H80000018&
ForeColor = &H00FF0000&
Height = 180
Left = 2400
TabIndex = 5
Top = 1080
Width = 90
End
End
Attribute VB_Name = "dy_rqfw"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim t_rq As String
Dim ret_tf As Boolean
Dim RQ1 As Date
Dim RQ2 As Date
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEscape Then
ret_tf = False
Unload Me
End If
End Sub
Private Sub Form_Load()
KeyPreview = True
m_qsrq.Text = Date - 7
m_qsrq.SelLength = 11
m_jzrq.Text = Format(Date, "yyyy-mm-dd")
m_jzrq.SelLength = 11
End Sub
Public Property Get tf() As Boolean
tf = ret_tf
End Property
Public Property Let tf(t_f As Boolean)
t_f = tf
End Property
Private Sub m_jzrq_Change()
MSG.Caption = ""
End Sub
Private Sub m_jzrq_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
If Not m_jzrq.Text = " - - " Then
t_rq = date_cl(m_jzrq.Text)
If t_rq <> "F" Then
m_jzrq = t_rq
End If
If IsDate(m_jzrq.Text) Then
If CDate(m_jzrq.Text) > CDate(m_qsrq.Text) Then
RQ1 = CDate(m_qsrq.Text)
RQ2 = CDate(m_jzrq.Text)
ret_tf = True
Unload Me
Else
MSG.Caption = "无效截止日期!"
m_jzrq.SelStart = 0
m_jzrq.SelLength = Len(m_jzrq.Text)
End If
Else
MSG.Caption = "无效截止日期!"
m_jzrq.SelStart = 0
m_jzrq.SelLength = Len(m_jzrq.Text)
End If
End If
End If
End Sub
Private Sub m_qsrq_Change()
MSG.Caption = ""
End Sub
Private Sub m_qsrq_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
m_jzrq.SetFocus
m_jzrq.SelStart = 0
m_jzrq.SelLength = Len(m_jzrq.Text)
End If
End Sub
Private Sub m_qsrq_LostFocus()
If Not m_qsrq.Text = " - - " Then
t_rq = date_cl(m_qsrq.Text)
If t_rq <> "F" Then
m_qsrq = t_rq
End If
If IsDate(m_qsrq.Text) Then
m_jzrq.SetFocus
m_jzrq.SelStart = 0
m_jzrq.SelLength = Len(m_jzrq.Text)
Else
MSG.Caption = "无效起始日期!"
m_qsrq.SetFocus
m_qsrq.SelStart = 0
m_qsrq.SelLength = Len(Trim(m_qsrq.Text))
End If
End If
End Sub
Public Property Get date1() As Date
date1 = RQ1
End Property
Public Property Let date1(RRQ1 As Date)
RRQ1 = date1
End Property
Public Property Get date2() As Date
date2 = RQ2
End Property
Public Property Let date2(RRQ2 As Date)
RRQ2 = date2
End Property
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -