📄 minfor.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmminfor
AutoRedraw = -1 'True
Caption = "Minfor"
ClientHeight = 8040
ClientLeft = 60
ClientTop = 345
ClientWidth = 10890
LinkTopic = "Form2"
MDIChild = -1 'True
ScaleHeight = 8040
ScaleWidth = 10890
WindowState = 2 'Maximized
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "minfor.frx":0000
Height = 5235
Left = 120
TabIndex = 2
Top = 1740
Width = 10635
_ExtentX = 18759
_ExtentY = 9234
_Version = 393216
HeadLines = 1
RowHeight = 15
AllowAddNew = -1 'True
AllowDelete = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc_minfor
Height = 495
Left = 240
Top = 7320
Visible = 0 'False
Width = 1995
_ExtentX = 3519
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=InventoryDB;Data Source=(local)"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from minfor"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 765
Left = 0
TabIndex = 0
Top = 0
Width = 10890
_ExtentX = 19209
_ExtentY = 1349
ButtonWidth = 1138
ButtonHeight = 1349
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 9
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Add"
Key = "add"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Modify"
Key = "modify"
ImageIndex = 2
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Delete"
Key = "delete"
ImageIndex = 3
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Find"
Key = "find"
ImageIndex = 4
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "Quit"
Key = "quit"
ImageIndex = 5
EndProperty
EndProperty
Begin MSComctlLib.ImageList ImageList1
Left = 3600
Top = 120
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 5
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "minfor.frx":001B
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "minfor.frx":046F
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "minfor.frx":08C3
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "minfor.frx":0D17
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "minfor.frx":116B
Key = ""
EndProperty
EndProperty
End
End
Begin VB.Label Label1
Caption = " Material Information"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 2460
TabIndex = 1
Top = 840
Width = 5115
End
End
Attribute VB_Name = "frmminfor"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "add"
common_str = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=InventoryDB;Data Source=(local);"
Adodc_minfor.ConnectionString = common_str
If Adodc_minfor.Recordset.EOF Or Adodc_minfor.Recordset.BOF Then
MsgBox "Please enter data before press add key", vbOKOnly, "Error"
ElseIf Not Adodc_minfor.Recordset.EOF Or Not Adodc_minfor.Recordset.BOF Then
With Adodc_minfor
.CommandType = adCmdText
.CommandTimeout = 0
.RecordSource = "select * from minfor"
.Recordset.MoveNext
End With
End If
Case "modify"
If Adodc_minfor.Recordset.EOF Or Adodc_minfor.Recordset.BOF Then
MsgBox "Please modify data before press this key", vbOKOnly, "Error"
ElseIf Not Adodc_minfor.Recordset.EOF Or Not Adodc_minfor.Recordset.BOF Then
Adodc_minfor.Recordset.Update
Adodc_minfor.Recordset.MoveNext
End If
Case "delete"
If Adodc_minfor.Recordset.EOF Or Adodc_minfor.Recordset.BOF Then
MsgBox "There have no data to del!", vbOKOnly, "Error"
ElseIf Not Adodc_minfor.Recordset.EOF Or Not Adodc_minfor.Recordset.BOF Then
Adodc_minfor.Recordset.Delete
Adodc_minfor.Refresh
End If
Case "find"
Findp.Label1.Caption = "frmminfor"
With Findp.Combo1
.Clear
.Text = "MaterialID"
.AddItem "MaterialID"
.AddItem "MaterialName"
.AddItem "Unit"
.AddItem "ModeNo"
.AddItem "Color"
.AddItem "Hardness"
.AddItem "MaxQty"
.AddItem "MinQty"
.AddItem "Unitprice"
.AddItem "Remarks"
Findp.Show 1
End With
Case "quit"
Unload Me
Case Else
MsgBox Button.Key & "Is Pressed"
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -