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

📄 frmsetelapsedtime.frm

📁 利用VB开发的针对Maxim-Dallas DS2770电量检测芯片
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmSetElapsedTime 
   Caption         =   "Set Elapsed Time Register"
   ClientHeight    =   1470
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3750
   Icon            =   "frmSetElapsedTime.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   1470
   ScaleWidth      =   3750
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton cmdOK 
      Caption         =   "OK"
      Height          =   375
      Left            =   2280
      TabIndex        =   5
      Top             =   1080
      Width           =   1455
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   375
      Left            =   720
      TabIndex        =   4
      Top             =   1080
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      Height          =   975
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   3735
      Begin VB.TextBox txtMinutes 
         Alignment       =   2  'Center
         Height          =   285
         Left            =   1920
         TabIndex        =   2
         Text            =   "00"
         Top             =   480
         Width           =   735
      End
      Begin VB.TextBox txtHours 
         Alignment       =   2  'Center
         Height          =   285
         Left            =   960
         TabIndex        =   1
         Text            =   "00"
         Top             =   480
         Width           =   735
      End
      Begin VB.Label Label4 
         Alignment       =   2  'Center
         BackStyle       =   0  'Transparent
         Caption         =   "Minutes"
         Height          =   255
         Left            =   1920
         TabIndex        =   7
         Top             =   240
         Width           =   735
      End
      Begin VB.Label Label3 
         Alignment       =   2  'Center
         BackStyle       =   0  'Transparent
         Caption         =   "Hours"
         Height          =   255
         Left            =   960
         TabIndex        =   6
         Top             =   240
         Width           =   735
      End
      Begin VB.Label Label1 
         Alignment       =   2  'Center
         BackStyle       =   0  'Transparent
         Caption         =   ":"
         Height          =   255
         Left            =   1680
         TabIndex        =   3
         Top             =   480
         Width           =   255
      End
   End
End
Attribute VB_Name = "frmSetElapsedTime"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
Dim LSB As Byte
Dim MSB As Byte
Dim NewETR As Double

    NewETR = (Val(txtHours.Text) / 0.015625) + _
    (Val(txtMinutes.Text) / (0.015625 * 60)) '+ _
    (Val(txtSeconds.Text) / (0.015625 * 3600))
    
    If NewETR > 65535 Then NewETR = 65535
    
    LSB = NewETR And &HFF
    MSB = ((NewETR And &HFF00) / &H100) And &HFF
    
    DataIn(2) = MSB And &HFF
    DataIn(3) = LSB And &HFF
    DataIn(4) = 0 And &HFF
    DataIn(5) = 0 And &HFF

    WriteBytes 2, 4
    
    Unload Me
End Sub

Private Sub Form_Load()
    txtHours.Text = Format(Hours, "00")
    txtMinutes.Text = Format(Minutes, "00")
    'txtSeconds.Text = Format(Seconds, "00")
End Sub

⌨️ 快捷键说明

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