?? frmstore.frm
字號(hào):
Command4.Enabled = True
Else
Command4.Enabled = False
End If
End Sub
Private Sub FocusText1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Trim(FocusText1.Text) <> "" Then
If Command4.Enabled = True Then Call Command4_Click
End If
End Sub
Private Sub FocusText2_KeyPress(KeyAscii As Integer)
If FocusText2.Text <> "" And KeyAscii = 13 Then
Call Command7_Click
End If
End Sub
Private Sub Form_Load()
FormID = "RK100"
Screen.MousePointer = 11
'安裝項(xiàng)目
GuestLay = 1
StartLoad
'配置網(wǎng)格
ConfigData
New_AniCur.AniFileName = App.Path & "\sys\2.ani"
New_AniCur.SetAniCursor cmdSelectGuest.hwnd
Screen.MousePointer = 0
End Sub
Private Sub Form_Resize()
If Me.WindowState = 1 Then Exit Sub
On Error Resume Next
lbStatus.left = Me.Width - lbStatus.Width - 300
lbStatus.tOp = 150
picOperator.left = 20
picOperator.tOp = tbOrder.Height + 40
picOperator.Width = Me.ScaleWidth - 40
picOperator.Height = Me.ScaleHeight - tbOrder.Height - 60
With picSelectSuppler
.Width = Me.ScaleWidth
.left = 0 - .Width
.tOp = tbOrder.Height + 40
.Height = Me.ScaleHeight - tbOrder.Height - 40
End With
With picSelectP
.Width = Me.ScaleWidth
.left = 0 - .Width
.tOp = tbOrder.Height + 40
.Height = Me.ScaleHeight - tbOrder.Height - 40
End With
With picBrowser
.Width = Me.ScaleWidth
.left = 0 - .Width
.tOp = tbOrder.Height + 40
.Height = Me.ScaleHeight - tbOrder.Height - 40
End With
With Picture2
.Width = Me.ScaleWidth
.left = 0 - .Width
.tOp = tbOrder.Height + 40
.Height = Me.ScaleHeight - tbOrder.Height - 40
End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
'御載選擇供應(yīng)商窗體
If SupplerForm = True Then
Unload frmSuppler
End If
New_AniCur.RelaseAniCursor cmdSelectGuest.hwnd
Set New_AniCur = Nothing
End Sub
Private Sub Grid1_EnterCell()
On Error Resume Next
If txtEdit.Enabled = False Then Exit Sub
txtEdit.Text = ""
'如果上一行沒有填,下一行將不能繼續(xù)
If Grid1.Row > 1 Then
If Trim(Grid1.TextMatrix(Grid1.Row - 1, 1)) = "" Then
txtEdit.Visible = False
cmdSelect.Visible = False
Exit Sub
End If
End If
'編輯窗定位
txtEdit = ""
txtEdit.left = (Grid1.left + Grid1.CellLeft) - 10
txtEdit.tOp = Grid1.tOp + Grid1.CellTop - 10
txtEdit.Width = Grid1.CellWidth + 20
cmdSelect.tOp = Grid1.tOp + Grid1.CellTop + 8
cmdSelect.left = txtEdit.left + (txtEdit.Width - cmdSelect.Width) - 30
txtEdit.Visible = True
'單位 Lock
If Grid1.Col = 2 Then
txtEdit.Locked = True
Else
txtEdit.Locked = False
End If
'檢測(cè)行的類型
If Grid1.Col > 3 And Grid1.Col < 6 + CodeQua Then '貨幣
EnterType = 3
txtEdit.TextType = 有小數(shù)點(diǎn)數(shù)字
Else
EnterType = 1
txtEdit.TextType = 普通文本類型
End If
'選擇UnitID
If Grid1.Col = 1 Then
cmdSelect.Visible = True
Else
cmdSelect.Visible = False
End If
If EnterType = 3 Then '貨幣時(shí)更改
If Trim(Grid1.TextMatrix(Grid1.Row, 1)) <> "" Then
If Trim(Grid1.TextMatrix(Grid1.Row, Grid1.Col)) = "" Then
txtEdit.Text = 0
Else
txtEdit.Text = Grid1.Text
End If
Else
txtEdit.Text = Grid1.Text
End If
Else
txtEdit.Text = Grid1.Text
End If
txtEdit.Visible = True
txtEdit.SetFocus
End Sub
Private Sub Grid1_LeaveCell()
On Error Resume Next
If txtEdit.Enabled = False Then Exit Sub
'保留最后一次坐標(biāo)
Grid_old.Row = Grid1.Row
Grid_old.Col = Grid1.Col
If Grid1.Row = 0 Or Grid1.Col = 0 Then Exit Sub
If Grid_old.Col = 1 Then
If Trim(txtEdit.Text) = "" Then Exit Sub
'Search UnitID
ProductSearch Trim(txtEdit.Text), "Goods"
If GetProduct.Exsite = False Then
Exit Sub
Else
Dim sErr As Integer, sErrX As Integer
Dim x As Integer
For x = 1 To CodeQua + 2
If Grid1.TextMatrix(Grid1.Row, x + 3) = "" Then
sErrX = 1
Else
sErrX = 0
End If
sErr = sErr + sErrX
Next
If sErr >= CodeQua + 2 Then
Grid1.TextMatrix(Grid1.Row, 1) = GetProduct.ID
Grid1.TextMatrix(Grid1.Row, 2) = GetProduct.Name
Grid1.TextMatrix(Grid1.Row, 3) = GetProduct.Unit
For x = 1 To CodeQua
Grid1.TextMatrix(Grid1.Row, 3 + x) = 0
Next
Grid1.TextMatrix(Grid1.Row, 4 + CodeQua) = GetProduct.Price
Grid1.TextMatrix(Grid1.Row, 5 + CodeQua) = 0
Exit Sub
End If
End If
End If
'如果上一行沒有填,下一行將不能繼續(xù)
If Grid1.Row > 1 Then
If Trim(Grid1.TextMatrix(Grid1.Row - 1, 1)) = "" Then
Exit Sub
End If
End If
If EnterType = 3 Then
If Trim(txtEdit.Text) <> "" Then
If Trim(Grid1.TextMatrix(Grid1.Row, 1)) = "" Then
Grid1.Text = ""
Else
Grid1.Text = Trim(txtEdit)
End If
End If
Else
Grid1.Text = Trim(txtEdit)
End If
If Trim(Grid1.TextMatrix(Grid1.Row, 1)) <> "" Then
' 合計(jì)
For x = 1 To CodeQua + 2
If Trim(Grid1.TextMatrix(Grid1.Row, 3 + x)) = "" Then
Grid1.TextMatrix(Grid1.Row, 3 + x) = "0"
End If
Next
'光標(biāo)在數(shù)量與單價(jià)區(qū)時(shí)
If Grid1.Col > 3 And Grid1.Col <> 5 + CodeQua Then '有產(chǎn)品編號(hào)時(shí)
cJE = 0
For x = 1 To CodeQua
cJE = cJE + CCur(Grid1.TextMatrix(Grid1.Row, 3 + x))
Next
Grid1.TextMatrix(Grid1.Row, 5 + CodeQua) = CCur((Grid1.TextMatrix(Grid1.Row, 4 + CodeQua))) * cJE
ElseIf Grid1.Col > 3 Then
If CCur(Trim(Grid1.TextMatrix(Grid1.Row, 5 + CodeQua))) >= 0 Then '修改金額時(shí)自動(dòng)修改單價(jià)
cJE = 0
For x = 1 To CodeQua
cJE = cJE + CCur(Grid1.TextMatrix(Grid1.Row, 3 + x))
Next
Grid1.TextMatrix(Grid1.Row, 4 + CodeQua) = CCur(Grid1.TextMatrix(Grid1.Row, 5 + CodeQua)) / cJE
Grid1.TextMatrix(Grid1.Row, 5 + CodeQua) = CCur((Grid1.TextMatrix(Grid1.Row, 4 + CodeQua))) * cJE
End If
End If
End If
'Acount Qua and Amo
AcountThis
txtEdit.Visible = False
cmdSelect.Visible = False
txtEdit.Text = ""
End Sub
Private Sub Grid1_Scroll()
Call Grid1_ScrollBar
txtEdit.Visible = False
cmdSelect.Visible = False
End Sub
Private Sub Grid1_SelChange()
If txtEdit.Enabled = False Then Exit Sub
AcountThis
End Sub
Private Sub Grid2_DblClick()
If Grid2.Text = "" Then
Exit Sub
End If
If GuestLay = 2 Then
FormID = "RK100"
txtUnitID.Text = Grid2.TextMatrix(Grid2.Row, 1)
lbUnit = Grid2.TextMatrix(Grid2.Row, 2)
MovePic picSelectSuppler, False, Me, txtEdit, Grid2
Exit Sub
End If
If GuestLay = 1 Then
ConfigSuppler "Select * From Suppler Where Class='" & Grid2.Text & "'", False
End If
End Sub
Private Sub Grid2_KeyPress(KeyAscii As Integer)
If Grid2.Text = "" Then
Exit Sub
End If
If KeyAscii = 13 Then
KeyAscii = 0
If GuestLay = 2 Then
Me.txtUnitID.Text = Grid2.TextMatrix(Grid2.Row, 1)
Me.lbUnit = Grid2.TextMatrix(Grid2.Row, 2)
MovePic picSelectSuppler, False, Me, txtUnitID, Grid2
Exit Sub
End If
If GuestLay = 1 Then
ConfigSuppler "Select * From Suppler Where Class='" & Grid2.Text & "'", False
End If
End If
End Sub
Private Sub Grid3_KeyPress(KeyAscii As Integer)
If Grid3.Text = "" Then
Exit Sub
End If
If KeyAscii = 13 Then
KeyAscii = 0
If ProductLay = 2 Then
Me.txtEdit.Text = Grid3.TextMatrix(Grid3.Row, 1)
MovePic picSelectP, False, Me, txtEdit, Grid3
Exit Sub
End If
If ProductLay = 1 Then
ConfigProduct "Select * From Goods Where Class='" & Grid3.Text & "'", False
End If
End If
End Sub
Private Sub Grid4_DblClick()
If Trim(Grid4.Text) = "" Then Exit Sub
ShowOrder Grid4.Text
FormID = "RK100"
If txtUnitID.Enabled = True Then
tbOrder.Buttons(6).Enabled = True
tbOrder.Buttons(8).Enabled = True
tbOrder.Buttons(2).Enabled = True
End If
tbOrder.Buttons(4).Enabled = True
tbOrder.Buttons(1).Enabled = True
MovePic picBrowser, False, Me, Grid1, Grid4
txtEdit.Text = Grid1.Text
End Sub
Private Sub Grid5_DblClick()
If Trim(Grid5.Text) = "" Then Exit Sub
sRelateOrder = Grid5.Text
lbOrderNO.Caption = sRelateOrder
ShowRelateOrder Grid5.Text
Dim x As Integer
For x = 1 To 10
tbOrder.Buttons(x).Enabled = True
Next
MovePic Picture2, False, Me, txtEdit, Grid3
txtEdit.Text = Grid1.Text
End Sub
Private Sub picBrowser_Resize()
On Error Resume Next
Grid4.left = 0
Grid4.tOp = 0
Grid4.Width = picBrowser.ScaleWidth
Grid4.Height = picBrowser.ScaleHeight - picTool1.Height - 100
picTool1.left = 0
picTool1.tOp = Grid4.Height + 50
picTool1.Width = Grid4.Width
End Sub
Private Sub picOperator_Resize()
On Error Resume Next
Grid1.left = 120
Grid1.tOp = 1800
Grid1.Width = picOperator.Width - 300
Grid1.Height = picOperator.Height - 2400
Frame1.tOp = picOperator.Height - 650
Frame1.left = 120
Frame1.Width = Grid1.Width
cmdOrder.tOp = 0
cmdOrder.left = picOperator.Width - cmdOrder.Width - 70
End Sub
Private Sub picSelectP_Resize()
On Error Resume Next
Grid3.left = 0
Grid3.tOp = 0
Grid3.Width = picSelectP.ScaleWidth
Grid3.Height = picSelectP.ScaleHeight - P
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -