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

📄 frmautotimeset.frm

📁 一个功能比较完善的远程抄表软件
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmAutoTimeSet 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "自动采集时间设置"
   ClientHeight    =   2985
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5205
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   2985
   ScaleWidth      =   5205
   ShowInTaskbar   =   0   'False
   Begin VB.Frame Frame1 
      Caption         =   "选择每月采集日期:"
      Height          =   735
      Left            =   120
      TabIndex        =   6
      Top             =   930
      Width           =   3480
      Begin VB.TextBox txtDay 
         Height          =   330
         Left            =   630
         TabIndex        =   8
         Top             =   270
         Width           =   2175
      End
      Begin VB.VScrollBar vsb 
         Height          =   330
         Left            =   2565
         Max             =   -1
         Min             =   -31
         TabIndex        =   7
         Top             =   270
         Value           =   -1
         Width           =   240
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "设置当日的采集时间:"
      Height          =   1095
      Left            =   120
      TabIndex        =   3
      Top             =   1785
      Width           =   3480
      Begin VB.TextBox txtTime 
         Height          =   330
         Left            =   630
         TabIndex        =   4
         Top             =   315
         Width           =   2175
      End
      Begin VB.Label Label2 
         Caption         =   "格式为:   ""时:分:秒"""
         Height          =   240
         Left            =   630
         TabIndex        =   5
         Top             =   720
         Width           =   2355
      End
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      Height          =   375
      Left            =   3840
      TabIndex        =   2
      Top             =   240
      Width           =   1185
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      Height          =   375
      Left            =   3840
      TabIndex        =   1
      Top             =   885
      Width           =   1185
   End
   Begin VB.Frame Frame3 
      Caption         =   "选择采集方式:"
      Height          =   690
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   3480
      Begin VB.PictureBox Picture1 
         BorderStyle     =   0  'None
         Height          =   375
         Left            =   120
         ScaleHeight     =   375
         ScaleWidth      =   3255
         TabIndex        =   9
         Top             =   240
         Width           =   3255
         Begin VB.OptionButton optEveryMonth 
            Caption         =   "每月采集"
            Height          =   285
            Left            =   1680
            TabIndex        =   11
            Top             =   0
            Width           =   1365
         End
         Begin VB.OptionButton optEveryDay 
            Caption         =   "每日采集"
            Height          =   240
            Left            =   0
            TabIndex        =   10
            Top             =   45
            Width           =   1140
         End
      End
   End
End
Attribute VB_Name = "frmAutoTimeSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2007/07/09
'描    述:CBB三表户外计量系统 Ver 5.2
'网    站:http://www.Mndsoft.com/  (VB6源码博客)
'网    站:http://www.VbDnet.com/   (VB.NET源码博客,主要基于.NET2005)
'e-mail  :Mndsoft@163.com
'e-mail  :Mndsoft@126.com
'OICQ    :88382850
'          如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Option Explicit
Dim temStrTime As String
Dim temStrDay As String

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
On Error GoTo ProcError
    If optEveryMonth.Value Then

        'lstDay.Selected(lstDay.ListIndex) = True
        temStrDate = Year(Date) & "-" & Month(Date) & "-" & Trim(txtDay.Text)
        temStrTime = txtTime.Text
        'temStr = InputBox("请以24小时制输入自动采集时间" + Chr(13) + "格式--""时:分:秒""", Me.Caption, Format(AutoTime, "hh:nn:ss"))
        If IsDate(temStrTime) Then
            AutoTime = CDate(Trim(temStrTime))
'status
            AppendStatusInfo "设置自动采集时间每月" & txtDay.Text & "日" & "   " & AutoTime, icoBLUE
            SaveLog "设置自动采集时间每月" & txtDay.Text & "日" & "   " & AutoTime, 0
        Else
            If Trim(temStrTime) <> "" Then
                MsgBox "无效的时间格式,请按提示格式输入", vbExclamation, Me.Caption
            End If
        End If
    
    Else

        temStrDate = Trim(Format(Date, "yyyy-mm-d"))
        temStrTime = txtTime.Text
        If IsDate(temStrTime) Then
            AutoTime = CDate(Trim(temStrTime))
'status
            AppendStatusInfo "设置每日自动采集时间  " & AutoTime, icoBLUE
            SaveLog "设置每日自动采集时间  " & AutoTime, 0
        Else
            If Trim(temStrTime) <> "" Then
                MsgBox "无效的时间格式,请按提示格式输入", vbExclamation, Me.Caption
            End If
        End If
    End If
    temStrDay = Trim(txtDay.Text)
    Unload Me
    Exit Sub
ProcError:
    ProcErr
End Sub

Private Sub Form_Load()
On Error GoTo ProcError
    If UBound(curForm) > 0 Then
        curForm(UBound(curForm)).Enabled = False
    End If
    ReDim Preserve curForm(UBound(curForm) + 1)
    Set curForm(UBound(curForm)) = Me
    


    If temStrTime = "" Then
        txtTime.Text = Trim("00:00:00")
    Else
        txtTime.Text = Trim(temStrTime)
    End If
    If temStrDay = "" Then
        vsb.Value = -1
        txtDay.Text = Abs(vsb.Value)
     
    Else
        txtDay.Text = Trim(temStrDay)
    End If
    optEveryMonth.Value = True
    Exit Sub
ProcError:
    ProcErr
End Sub

Private Sub Form_Unload(Cancel As Integer)
    ReDim Preserve curForm(UBound(curForm) - 1)
    If UBound(curForm) > 0 Then
        curForm(UBound(curForm)).Enabled = True
    End If
End Sub


Private Sub optEveryDay_Click()
        txtDay.Enabled = False
        vsb.Enabled = False
        Frame1.Enabled = False
        txtTime.Enabled = True
        Frame2.Enabled = True
        Label2.Enabled = True
End Sub

Private Sub optEveryMonth_Click()
        txtDay.Enabled = True
        vsb.Enabled = True
        Frame1.Enabled = True
        txtTime.Enabled = True
        Frame2.Enabled = True
        Label2.Enabled = True
End Sub

Private Sub vsb_Change()
    txtDay.Text = Abs(vsb.Value)
End Sub

⌨️ 快捷键说明

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