📄 productmove2.frm
字号:
VERSION 5.00
Begin VB.Form ProductMove2
AutoRedraw = -1 'True
BorderStyle = 3 'Fixed Dialog
Caption = "调拨数量"
ClientHeight = 1335
ClientLeft = 45
ClientTop = 330
ClientWidth = 3840
Icon = "ProductMove2.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1335
ScaleWidth = 3840
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
BackColor = &H00808000&
Height = 1065
Left = 135
ScaleHeight = 1005
ScaleWidth = 3495
TabIndex = 1
Top = 150
Width = 3555
Begin VB.TextBox Dbtxt
Height = 300
Left = 240
MaxLength = 8
TabIndex = 0
Top = 480
Width = 2970
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "请输入要调拨的数量,然后按回车键!"
ForeColor = &H0000FF00&
Height = 180
Left = 285
TabIndex = 2
Top = 210
Width = 2880
End
End
End
Attribute VB_Name = "ProductMove2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Dbtxt_Change()
If Val(Dbtxt.Text) > Val(ProductMove1.Grid2.TextMatrix(RowNumber, 2)) Then
MsgBox ProductMove1.Grid2.Text + "数量只有:" & ProductMove1.Grid2.TextMatrix(RowNumber, 2), vbOKOnly + 64, "数量不够"
Dbtxt.Text = ProductMove1.Grid2.TextMatrix(RowNumber, 2)
End If
End Sub
Private Sub Dbtxt_GotFocus()
Dbtxt.SelStart = 0
Dbtxt.SelLength = Len(Dbtxt.Text)
End Sub
Private Sub Dbtxt_KeyPress(KeyAscii As Integer)
If KeyAscii <> 13 Then
If NumberTrue(KeyAscii, Dbtxt) = False Then
KeyAscii = 0
End If
Else
If Val(Dbtxt.Text) = 0 Then
DbTrue = False
Unload Me
Else
DbNumber = Val(Dbtxt.Text)
DbTrue = True
Unload Me
End If
End If
End Sub
Private Sub Form_Load()
ProductMove2.Caption = ProductMove1.Grid2.Text + "数量还有" & ProductMove1.Grid2.TextMatrix(RowNumber, 2)
DbTrue = False
End Sub
Function NumberTrue(keyNumber As Integer, NumberStr As TextBox) As Boolean
'转入退格键时
If keyNumber = 8 Then
If Len(Trim(NumberStr.Text)) > 0 Then
Dim Tstr As String
Tstr = Left(NumberStr.Text, Len(NumberStr.Text) - 1)
NumberStr.SelLength = 0
NumberStr.SelStart = Len(Trim(Tstr)) + 1
NumberTrue = True
Exit Function
End If
End If
If keyNumber >= 46 And keyNumber <= 57 And keyNumber <> 47 Then
NumberTrue = True
Else
NumberTrue = False
End If
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -