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

📄 frmpay.frm

📁 便利店管理系统 VB+ACCESS 附上数据库和源码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmPay 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "付款"
   ClientHeight    =   3765
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6630
   Icon            =   "frmPay.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3765
   ScaleWidth      =   6630
   StartUpPosition =   1  'CenterOwner
   Begin VB.Frame Frame1 
      BackColor       =   &H8000000A&
      Height          =   3675
      Left            =   60
      TabIndex        =   5
      Top             =   0
      Width           =   6495
      Begin VB.TextBox txMoneyPayValue 
         BackColor       =   &H00FFFFC0&
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   24
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   675
         Left            =   2220
         TabIndex        =   0
         Text            =   "0"
         Top             =   1140
         Width           =   4000
      End
      Begin VB.TextBox txMoneyTotal 
         BackColor       =   &H00C0FFFF&
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """¥""#,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   2
         EndProperty
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   24
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   735
         Left            =   2220
         Locked          =   -1  'True
         TabIndex        =   3
         Text            =   "0"
         Top             =   240
         Width           =   4000
      End
      Begin VB.TextBox txMoneyChange 
         BackColor       =   &H00C0FFFF&
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """¥""#,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   2
         EndProperty
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   24
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   735
         Left            =   2220
         Locked          =   -1  'True
         TabIndex        =   4
         Text            =   "0"
         Top             =   1980
         Width           =   4000
      End
      Begin VB.CommandButton cmdOK 
         Caption         =   "确定"
         Default         =   -1  'True
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   555
         Left            =   1320
         TabIndex        =   1
         Top             =   2940
         Width           =   1455
      End
      Begin VB.CommandButton cmdCancel 
         Cancel          =   -1  'True
         Caption         =   "取消"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   555
         Left            =   3660
         TabIndex        =   2
         Top             =   2940
         Width           =   1455
      End
      Begin VB.Label lbMoneyTotal 
         Alignment       =   1  'Right Justify
         AutoSize        =   -1  'True
         Caption         =   "合计"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   24
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   555
         Left            =   240
         TabIndex        =   8
         Top             =   300
         Width           =   1875
      End
      Begin VB.Label lbMoneyPay 
         Alignment       =   1  'Right Justify
         AutoSize        =   -1  'True
         Caption         =   "付款"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   24
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   555
         Left            =   240
         TabIndex        =   7
         Top             =   1200
         Width           =   1875
      End
      Begin VB.Label lbMoneyChange 
         Alignment       =   1  'Right Justify
         AutoSize        =   -1  'True
         Caption         =   "找零"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   24
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   555
         Left            =   240
         TabIndex        =   6
         Top             =   2040
         Width           =   1875
      End
   End
End
Attribute VB_Name = "frmPay"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub LoadFormLang()
    Me.Caption = getResource("resPayment")
    
    Me.lbMoneyTotal.Caption = getResource("resTotal")
    Me.lbMoneyPay.Caption = getResource("resPayment")
    Me.lbMoneyChange.Caption = getResource("resChange1")
    
    Me.cmdOK.Caption = getResource("resOK")
    Me.cmdCancel.Caption = getResource("rescancel")
End Sub

Private Sub cmdCancel_Click()
    cuPayMoney.Total = CDbl(Me.txMoneyTotal.Text)
    cuPayMoney.Pay = CDbl(Me.txMoneyPayValue.Text)
    cuPayMoney.Change = CDbl(Me.txMoneyChange.Text)
    cuPayMoney.Flag = 0

    Unload Me
End Sub

Private Sub cmdOK_Click()
    cuPayMoney.Total = CDbl(Me.txMoneyTotal.Text)
    cuPayMoney.Pay = CDbl(Me.txMoneyPayValue.Text)
    cuPayMoney.Change = CDbl(Me.txMoneyChange.Text)
    
    cuPayMoney.Flag = 1
    
    Unload Me
End Sub

Private Sub Form_Load()
    Call LoadFormLang
    
    Me.txMoneyTotal.Text = Format$(cuPayMoney.Total, "##,##0.00") '"Currency")
    Me.txMoneyPayValue.SelLength = 50
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    If UnloadMode <> 1 Then
        Cancel = True
    End If
End Sub

Private Sub txMoneyPayValue_Change()
On Error GoTo errDealWith
    If TestText(Me.txMoneyChange.Text) Then
        Me.txMoneyChange.Text = Format$(CDbl(Me.txMoneyPayValue.Text) - CDbl(Me.txMoneyTotal.Text), "##,##0.00")
        If CDbl(Me.txMoneyChange.Text) < 0 Then
            Me.cmdOK.Enabled = False
        Else
            Me.cmdOK.Enabled = True
        End If
    'Else
    '    Me.txMoneyChange.Text = "0"
    '    Me.txMoneyPayValue.SelLength = 50
    End If
errExit:
    Exit Sub
errDealWith:
    'MsgBox "输入错误!", vbCritical + vbOKOnly
    Me.txMoneyPayValue.Text = "0"
    Me.txMoneyPayValue.SelLength = 50
    Resume errExit
End Sub

Private Sub txMoneyPayValue_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        Me.cmdOK.SetFocus
    Else
        KeyAscii = CheckDec(KeyAscii, Me.txMoneyPayValue.Text)
        
    End If
End Sub

⌨️ 快捷键说明

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