?? frmplanstock.frm
字號:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmPlanStock
BorderStyle = 3 'Fixed Dialog
Caption = "計劃進(jìn)貨"
ClientHeight = 5670
ClientLeft = 45
ClientTop = 330
ClientWidth = 6450
Icon = "frmPlanStock.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 378
ScaleMode = 3 'Pixel
ScaleWidth = 430
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin MSComctlLib.ImageList ImageList1
Left = 1440
Top = 4080
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 1
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmPlanStock.frx":000C
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.ListView List1
Height = 4470
Left = 120
TabIndex = 0
Top = 120
Width = 6180
_ExtentX = 10901
_ExtentY = 7885
View = 3
LabelEdit = 1
MultiSelect = -1 'True
LabelWrap = -1 'True
HideSelection = 0 'False
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
SmallIcons = "ImageList1"
ForeColor = -2147483640
BackColor = -2147483643
Appearance = 1
NumItems = 4
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "商品名稱"
Object.Width = 3175
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "計劃進(jìn)貨數(shù)量"
Object.Width = 2381
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "計劃進(jìn)貨日期"
Object.Width = 2381
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "當(dāng)前庫存量"
Object.Width = 2646
EndProperty
End
Begin MySuperMarket.FTextBox txtDate
Height = 300
Left = 4200
TabIndex = 1
Top = 4710
Width = 1515
_extentx = 2672
_extenty = 529
font = "frmPlanStock.frx":05A6
fontname = "宋體"
fontsize = 9
autoselall = -1 'True
End
Begin MySuperMarket.FTextBox txtNum
Height = 300
Left = 1440
TabIndex = 2
Top = 4710
Width = 1155
_extentx = 2037
_extenty = 529
font = "frmPlanStock.frx":05CA
fontname = "宋體"
fontsize = 9
text = "00"
selstart = 1
autoselall = -1 'True
isnumber = -1 'True
maxlength = 5
afterdecimal = 0
End
Begin MySuperMarket.XPButton cmdExit
Cancel = -1 'True
Height = 345
Left = 5220
TabIndex = 3
Top = 5160
Width = 1095
_extentx = 1931
_extenty = 609
caption = "取消"
capalign = 2
backstyle = 2
font = "frmPlanStock.frx":05EE
mode = 0
value = 0 'False
cback = -2147483633
End
Begin MySuperMarket.XPButton cmdOK
Default = -1 'True
Height = 345
Left = 4020
TabIndex = 4
Top = 5160
Width = 1095
_extentx = 1931
_extenty = 609
caption = "確定"
capalign = 2
backstyle = 2
font = "frmPlanStock.frx":0612
mode = 0
value = 0 'False
cback = -2147483633
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "注:按 Delete 可以刪除選中項"
ForeColor = &H00FF0000&
Height = 180
Left = 120
TabIndex = 7
Top = 5250
Width = 2520
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "計劃進(jìn)貨數(shù)量:"
Height = 180
Left = 120
TabIndex = 6
Top = 4770
Width = 1260
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "計劃進(jìn)貨日期:"
Height = 180
Left = 2880
TabIndex = 5
Top = 4770
Width = 1260
End
End
Attribute VB_Name = "frmPlanStock"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
On Error GoTo aaaa
Dim i As Long, j As Long
j = List1.ListItems.Count
If j = 0 Then Exit Sub
If MsgBox("確定添加這 " & j & " 個計劃進(jìn)貨記錄嗎?", vbInformation + vbOKCancel + vbDefaultButton2) = vbCancel Then Exit Sub
For i = 1 To List1.ListItems.Count
cnMain.Execute "insert Stock values(" & MID$(List1.ListItems(i).Key, 2) _
& "," & List1.ListItems(i).SubItems(1) _
& ",NULL,NULL,'" & List1.ListItems(i).SubItems(2) _
& "',NULL,0)"
Next
Unload Me
If frmMain.cmdLeft(2).IfDraw = False Then
frmMain.cmdLeft_Click 2
Else
frmStock.LoadPlanStock
End If
Exit Sub
aaaa:
MsgBox Err.Description, vbCritical
End Sub
Private Sub Form_Load()
Move frmMain.Left + (frmMain.Width - Me.Width) / 2, frmMain.Top + (frmMain.Height - Me.Height) / 2
End Sub
Private Sub List1_ItemClick(ByVal Item As MSComctlLib.ListItem)
txtNum.Text = Item.SubItems(1)
txtDate.Text = Item.SubItems(2)
End Sub
Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo aaaa
If KeyCode = vbKeyDelete Then
Dim i As Long, j As Long
j = 0
For i = 1 To List1.ListItems.Count
If List1.ListItems(i).Selected = True Then j = j + 1
Next
If j = 0 Then Exit Sub
If MsgBox("確定刪除選中的 " & j & " 個預(yù)計劃進(jìn)貨記錄嗎?", vbInformation + vbOKCancel + vbDefaultButton2) = vbCancel Then Exit Sub
For i = List1.ListItems.Count To 1 Step -1
If List1.ListItems(i).Selected = True Then
List1.ListItems.Remove i
End If
Next
If List1.ListItems.Count = 0 Then cmdOK.Enabled = False
End If
If KeyCode = vbKeyA And Shift = 2 Then
For j = 1 To List1.ListItems.Count
List1.ListItems(j).Selected = True
Next
End If
Exit Sub
aaaa:
MsgBox Err.Description, vbCritical
End Sub
Private Sub txtDate_Change()
On Error GoTo aaaa
Dim d As Date
d = CDate(txtDate.Text)
List1.SelectedItem.SubItems(2) = Format(d, "yyyy-mm-dd")
aaaa:
End Sub
Private Sub txtNum_Change()
On Error GoTo aaaa
Dim j As Long
j = CLng(txtNum.Text)
If j > 0 Then List1.SelectedItem.SubItems(1) = j
aaaa:
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -