📄 goodsgroup.vb
字号:
Public Class GoodsGroup
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写 dispose 以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents tvGoodsGroup As System.Windows.Forms.TreeView
Friend WithEvents cmdAdd As System.Windows.Forms.Button
Friend WithEvents cmdMod As System.Windows.Forms.Button
Friend WithEvents cmdDel As System.Windows.Forms.Button
Friend WithEvents Button1 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.tvGoodsGroup = New System.Windows.Forms.TreeView
Me.cmdAdd = New System.Windows.Forms.Button
Me.cmdMod = New System.Windows.Forms.Button
Me.cmdDel = New System.Windows.Forms.Button
Me.Button1 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'tvGoodsGroup
'
Me.tvGoodsGroup.ImageIndex = -1
Me.tvGoodsGroup.Location = New System.Drawing.Point(0, 0)
Me.tvGoodsGroup.Name = "tvGoodsGroup"
Me.tvGoodsGroup.SelectedImageIndex = -1
Me.tvGoodsGroup.Size = New System.Drawing.Size(152, 264)
Me.tvGoodsGroup.TabIndex = 0
'
'cmdAdd
'
Me.cmdAdd.Location = New System.Drawing.Point(168, 24)
Me.cmdAdd.Name = "cmdAdd"
Me.cmdAdd.TabIndex = 1
Me.cmdAdd.Text = "添 加"
'
'cmdMod
'
Me.cmdMod.Location = New System.Drawing.Point(168, 80)
Me.cmdMod.Name = "cmdMod"
Me.cmdMod.TabIndex = 2
Me.cmdMod.Text = "修 改"
'
'cmdDel
'
Me.cmdDel.Location = New System.Drawing.Point(168, 144)
Me.cmdDel.Name = "cmdDel"
Me.cmdDel.TabIndex = 4
Me.cmdDel.Text = "删 除"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(168, 208)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 5
Me.Button1.Text = "退 出"
'
'GoodsGroup
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(296, 262)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.cmdDel)
Me.Controls.Add(Me.cmdMod)
Me.Controls.Add(Me.cmdAdd)
Me.Controls.Add(Me.tvGoodsGroup)
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "GoodsGroup"
Me.Text = "货品类别设置"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub GoodsGroup_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
tvGoodsGroup.Nodes.Clear()
Goods.ShowGoodsGroup(tvGoodsGroup)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click
Dim name As String = InputBox("输入新类型名", "输入")
Dim newNode As TreeNode = New TreeNode(name)
tvGoodsGroup.SelectedNode.Nodes.Add(newNode)
End Sub
Private Sub cmdDel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDel.Click
tvGoodsGroup.Nodes.Remove(tvGoodsGroup.SelectedNode)
End Sub
Private Sub cmdMod_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdMod.Click
Dim name As String = InputBox("修改类型名", "修改", tvGoodsGroup.SelectedNode.Text)
tvGoodsGroup.SelectedNode.Text = name
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -