📄 spxx.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form spxx
Caption = "商品信息"
ClientHeight = 9510
ClientLeft = 1875
ClientTop = 2475
ClientWidth = 14970
ForeColor = &H00C0C0FF&
Icon = "spxx.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 9510
ScaleWidth = 14970
WindowState = 2 'Maximized
Begin VB.CommandButton Command6
Caption = "查询(&C)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3120
TabIndex = 8
Top = 8880
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "退出(&E)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 10320
TabIndex = 7
Top = 8880
Width = 1095
End
Begin VB.CommandButton Command5
Caption = "打印(&P)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 8880
TabIndex = 6
Top = 8880
Width = 1095
End
Begin VB.CommandButton Command4
Caption = "修改(&X)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 7440
TabIndex = 5
Top = 8880
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "删除(&D)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6000
TabIndex = 4
Top = 8880
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "添加(&A)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4560
TabIndex = 3
Top = 8880
Width = 1095
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 495
Left = 3360
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 4560
Visible = 0 'False
Width = 2295
End
Begin MSComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 480
Left = 0
TabIndex = 1
Top = 9030
Width = 14970
_ExtentX = 26405
_ExtentY = 847
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 5
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
AutoSize = 1
Enabled = 0 'False
Object.Width = 9781
MinWidth = 4410
Text = "单击表头可选中整行或整列"
TextSave = "单击表头可选中整行或整列"
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
EndProperty
BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 4410
MinWidth = 4410
EndProperty
BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Object.Width = 6456
MinWidth = 6456
EndProperty
BeginProperty Panel5 {8E3867AB-8586-11D1-B16A-00C0F0283628}
EndProperty
EndProperty
End
Begin VB.Frame Frame1
Height = 8535
Left = 120
TabIndex = 0
Top = 120
Width = 15100
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid
Bindings = "spxx.frx":0442
Height = 8175
Left = 120
TabIndex = 2
Top = 240
Width = 14775
_ExtentX = 26061
_ExtentY = 14420
_Version = 393216
Rows = 20
Cols = 7
BackColor = -2147483624
ForeColor = 0
ForeColorFixed = 0
BackColorSel = 64
ForeColorSel = 16777215
BackColorBkg = 16777215
FocusRect = 2
GridLines = 3
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
End
End
Attribute VB_Name = "spxx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public c As Integer
Public strfing As String
Public dj As Integer
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
Me.Hide
tjsp.Show
End Sub
Private Sub Command3_Click()
c = spxx.MSFlexGrid.Row
strfind = spxx.MSFlexGrid.TextMatrix(c, 1)
On Error GoTo endthis
If dj = 1 Then
spxx.Data1.Recordset.FindFirst "spbh = " & "'" & strfind & "'"
'****************************************************
Msg = "确实要删除此记录吗?" ' 定义信息。
Style = vbYesNo + vbCritical + vbDefaultButton2 ' 定义按钮。
Title = "提示" ' 定义标题。
Ctxt = 1000 ' 定义标题
' 上下文。
' 显示信息。
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' 用户按下“是”。
MyString = "Yes" ' 完成某操作。
'czrygl.Data1.Recordset.MoveNext
'On Error GoTo endthis
spxx.Data1.Recordset.Delete
spxx.Data1.Refresh
spxx.Hide
Call Form_Activate
spxx.Show
Else ' 用户按下“否”。
MyString = "No" ' 完成某操作。
End If
'****************************************************
Else
MsgBox "请先选好要删除的商品。", vbInformation, "提示"
End If
endthis:
Exit Sub
End Sub
Private Sub Command4_Click()
c = spxx.MSFlexGrid.Row
If dj = 1 Then
strfind = spxx.MSFlexGrid.TextMatrix(c, 1)
On Error GoTo endthis
xgspxx.Data1.Recordset.FindFirst "spbh = " & "'" & strfind & "'"
xgspxx.Show
Unload Me
Else
MsgBox "请先选好要修改的商品。", vbInformation, "提示"
Exit Sub
End If
endthis:
Exit Sub
End Sub
Private Sub Command5_Click()
spxxrpt.Show
End Sub
Private Sub Command6_Click()
Me.Hide
czsp.Show
End Sub
Private Sub Form_Activate()
MSFlexGrid.TextMatrix(0, 1) = " 商品编号"
MSFlexGrid.TextMatrix(0, 2) = " 商品名称"
MSFlexGrid.TextMatrix(0, 3) = " 单位"
MSFlexGrid.TextMatrix(0, 4) = "供货商"
MSFlexGrid.TextMatrix(0, 5) = "产地"
MSFlexGrid.TextMatrix(0, 6) = " 备注"
MSFlexGrid.ColWidth(0) = 200
MSFlexGrid.ColWidth(1) = 1500
MSFlexGrid.ColWidth(2) = 2000
MSFlexGrid.ColWidth(5) = 1800
MSFlexGrid.ColWidth(6) = 1500
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\db1.mdb"
Data1.RecordSource = "select * from spxx"
End Sub
Private Sub MSFlexGrid_Click()
dj = 1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -