📄 frmstuffclass.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmstuffclass
BorderStyle = 3 'Fixed Dialog
ClientHeight = 3885
ClientLeft = 45
ClientTop = 330
ClientWidth = 5820
Icon = "frmstuffclass.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3885
ScaleWidth = 5820
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.PictureBox Picture1
BackColor = &H00404040&
Height = 615
Left = 0
ScaleHeight = 555
ScaleWidth = 5715
TabIndex = 7
Top = 3240
Width = 5775
Begin VB.CommandButton comok
BackColor = &H00C0E0FF&
Caption = "确定(&K)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
Style = 1 'Graphical
TabIndex = 10
Top = 120
Width = 1335
End
Begin VB.CommandButton comcancel
BackColor = &H00C0E0FF&
Caption = "取消(&C)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2100
Style = 1 'Graphical
TabIndex = 9
Top = 120
Width = 1335
End
Begin VB.CommandButton comadd
BackColor = &H00C0E0FF&
Caption = "增加(&A)"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3840
Style = 1 'Graphical
TabIndex = 8
Top = 120
Width = 1335
End
End
Begin MSComctlLib.ImageCombo fatherclass
Height = 375
Left = 1920
TabIndex = 1
Top = 1560
Width = 2055
_ExtentX = 3625
_ExtentY = 661
_Version = 393216
ForeColor = 0
BackColor = -2147483634
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.TextBox memo
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 1920
TabIndex = 2
Top = 2040
Width = 3015
End
Begin VB.TextBox txtname
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1920
TabIndex = 0
Top = 1080
Width = 2055
End
Begin VB.Line Line1
BorderColor = &H80000001&
BorderWidth = 5
X1 = -120
X2 = 5880
Y1 = 720
Y2 = 720
End
Begin VB.Label Label4
Caption = "说明:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 6
Top = 2040
Width = 855
End
Begin VB.Label Label3
Caption = "父类:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 5
Top = 1560
Width = 855
End
Begin VB.Label Label2
Caption = "类别:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 4
Top = 1080
Width = 855
End
Begin VB.Label Label1
Caption = "货品种类增加"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1560
TabIndex = 3
Top = 120
Width = 2895
End
End
Attribute VB_Name = "frmstuffclass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private rs As ADODB.Recordset
Private i As Integer
Private Sub comadd_Click()
On Error Resume Next
If Trim(txtname) = "" Or Trim(fatherclass.Text) = "" Or Trim(Mid(fatherclass.Text, 1, 1)) = "-" Then
MsgBox "输入资料有误!"
Exit Sub
End If
Set rs = New ADODB.Recordset
rs.Open "select * from stuffclasstable ", GetConnect, adOpenDynamic, adLockOptimistic
rs.AddNew
rs![Name] = Trim(txtname)
rs![fatherclass] = Mid(fatherclass.SelectedItem.Key, 2, 100)
rs![memo] = Trim(memo)
rs.Update
rs.Close
'刷新树型列表开始
FrmMainBrow.tvTreeView.Nodes.Clear
rs.Open "select * from stuffclasstable order by fatherclass", GetConnect, adOpenForwardOnly, adLockReadOnly
Do Until rs.EOF
If rs![fatherclass] = 0 Then
FrmMainBrow.tvTreeView.Nodes.Add , , "_" & Format(rs![ID], "00000"), rs![Name], 3, 4
Else
FrmMainBrow.tvTreeView.Nodes.Add "_" & Format(rs![fatherclass], "00000"), tvwChild, "_" & Format(rs![ID], "00000"), rs![Name], 3, 4
End If
rs.MoveNext
Loop
rs.Close
'刷新树型列表结束
Me.txtname = ""
Me.memo = ""
Me.txtname.SetFocus
End Sub
Private Sub comcancel_Click()
Unload Me
End Sub
Private Sub comok_Click()
On Error Resume Next
If Trim(txtname) = "" Or Trim(fatherclass.Text) = "" Or Trim(Mid(fatherclass.Text, 1, 1)) = "-" Then
MsgBox "输入资料有误!"
Exit Sub
End If
Set rs = New ADODB.Recordset
rs.Open "select * from stuffclasstable ", GetConnect, adOpenDynamic, adLockOptimistic
rs.AddNew
rs![Name] = Trim(txtname)
rs![fatherclass] = Mid(fatherclass.SelectedItem.Key, 2, 100)
rs![memo] = Trim(memo)
rs.Update
rs.Close
'刷新树型列表开始
FrmMainBrow.tvTreeView.Nodes.Clear
rs.Open "select * from stuffclasstable order by fatherclass", GetConnect, adOpenForwardOnly, adLockReadOnly
Do Until rs.EOF
If rs![fatherclass] = 0 Then
FrmMainBrow.tvTreeView.Nodes.Add , , "_" & Format(rs![ID], "00000"), rs![Name], 3, 4
Else
FrmMainBrow.tvTreeView.Nodes.Add "_" & Format(rs![fatherclass], "00000"), tvwChild, "_" & Format(rs![ID], "00000"), rs![Name], 3, 4
End If
rs.MoveNext
Loop
rs.Close
'刷新树型列表结束
Unload Me
End Sub
Private Sub Form_Load()
Set rs = New ADODB.Recordset
rs.Open "select * from stuffclasstable ", GetConnect, adOpenStatic, adLockReadOnly
fatherclass.ComboItems.Clear
If rs.EOF And rs.BOF Then
MsgBox ""
End If
fatherclass.ComboItems.Add , "_0", "无"
fatherclass.ComboItems.Add , "_Line", "----------"
For i = 1 To rs.RecordCount
fatherclass.ComboItems.Add , "_" & rs![ID], Trim(rs![Name])
rs.MoveNext
Next i
rs.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -