⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmfndprd.vb

📁 超市进销存管理系统的源码。基于.NET平台
💻 VB
字号:
Public Class frmFndPrd
    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 btnExt As System.Windows.Forms.Button
    Friend WithEvents dgdPrd As System.Windows.Forms.DataGrid
    Friend WithEvents grbPrd As System.Windows.Forms.GroupBox
    Friend WithEvents btnPrt As System.Windows.Forms.Button
    Friend WithEvents btnFnd As System.Windows.Forms.Button
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents cmbField1 As System.Windows.Forms.ComboBox
    Friend WithEvents cmbField2 As System.Windows.Forms.ComboBox
    Friend WithEvents txtVal1 As System.Windows.Forms.TextBox
    Friend WithEvents txtVal2 As System.Windows.Forms.TextBox
    Friend WithEvents cmbRel1 As System.Windows.Forms.ComboBox
    Friend WithEvents cmbRel3 As System.Windows.Forms.ComboBox
    Friend WithEvents cmbRel2 As System.Windows.Forms.ComboBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmfndPrd))
        Me.btnExt = New System.Windows.Forms.Button
        Me.dgdPrd = New System.Windows.Forms.DataGrid
        Me.grbPrd = New System.Windows.Forms.GroupBox
        Me.Label3 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.txtVal2 = New System.Windows.Forms.TextBox
        Me.txtVal1 = New System.Windows.Forms.TextBox
        Me.cmbRel2 = New System.Windows.Forms.ComboBox
        Me.cmbField2 = New System.Windows.Forms.ComboBox
        Me.cmbRel3 = New System.Windows.Forms.ComboBox
        Me.cmbRel1 = New System.Windows.Forms.ComboBox
        Me.cmbField1 = New System.Windows.Forms.ComboBox
        Me.Label1 = New System.Windows.Forms.Label
        Me.btnFnd = New System.Windows.Forms.Button
        Me.btnPrt = New System.Windows.Forms.Button
        CType(Me.dgdPrd, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.grbPrd.SuspendLayout()
        Me.SuspendLayout()
        '
        'btnExt
        '
        Me.btnExt.Font = New System.Drawing.Font("宋体", 15.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.btnExt.ForeColor = System.Drawing.Color.Teal
        Me.btnExt.Location = New System.Drawing.Point(512, 432)
        Me.btnExt.Name = "btnExt"
        Me.btnExt.Size = New System.Drawing.Size(88, 40)
        Me.btnExt.TabIndex = 25
        Me.btnExt.Text = "退  出"
        '
        'dgdPrd
        '
        Me.dgdPrd.AlternatingBackColor = System.Drawing.Color.GhostWhite
        Me.dgdPrd.BackColor = System.Drawing.Color.GhostWhite
        Me.dgdPrd.BackgroundColor = System.Drawing.Color.Lavender
        Me.dgdPrd.BorderStyle = System.Windows.Forms.BorderStyle.None
        Me.dgdPrd.CaptionBackColor = System.Drawing.Color.RoyalBlue
        Me.dgdPrd.CaptionForeColor = System.Drawing.Color.White
        Me.dgdPrd.CaptionVisible = False
        Me.dgdPrd.DataMember = ""
        Me.dgdPrd.FlatMode = True
        Me.dgdPrd.Font = New System.Drawing.Font("Tahoma", 8.0!)
        Me.dgdPrd.ForeColor = System.Drawing.Color.MidnightBlue
        Me.dgdPrd.GridLineColor = System.Drawing.Color.RoyalBlue
        Me.dgdPrd.HeaderBackColor = System.Drawing.Color.MidnightBlue
        Me.dgdPrd.HeaderFont = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Bold)
        Me.dgdPrd.HeaderForeColor = System.Drawing.Color.Lavender
        Me.dgdPrd.LinkColor = System.Drawing.Color.Teal
        Me.dgdPrd.Location = New System.Drawing.Point(24, -24)
        Me.dgdPrd.Name = "dgdPrd"
        Me.dgdPrd.ParentRowsBackColor = System.Drawing.Color.Lavender
        Me.dgdPrd.ParentRowsForeColor = System.Drawing.Color.MidnightBlue
        Me.dgdPrd.ReadOnly = True
        Me.dgdPrd.SelectionBackColor = System.Drawing.Color.Teal
        Me.dgdPrd.SelectionForeColor = System.Drawing.Color.PaleGreen
        Me.dgdPrd.Size = New System.Drawing.Size(605, 157)
        Me.dgdPrd.TabIndex = 22
        '
        'grbPrd
        '
        Me.grbPrd.Controls.Add(Me.Label3)
        Me.grbPrd.Controls.Add(Me.Label2)
        Me.grbPrd.Controls.Add(Me.txtVal2)
        Me.grbPrd.Controls.Add(Me.txtVal1)
        Me.grbPrd.Controls.Add(Me.cmbRel2)
        Me.grbPrd.Controls.Add(Me.cmbField2)
        Me.grbPrd.Controls.Add(Me.cmbRel3)
        Me.grbPrd.Controls.Add(Me.cmbRel1)
        Me.grbPrd.Controls.Add(Me.cmbField1)
        Me.grbPrd.Controls.Add(Me.Label1)
        Me.grbPrd.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.grbPrd.ForeColor = System.Drawing.Color.Blue
        Me.grbPrd.Location = New System.Drawing.Point(0, 144)
        Me.grbPrd.Name = "grbPrd"
        Me.grbPrd.Size = New System.Drawing.Size(745, 272)
        Me.grbPrd.TabIndex = 20
        Me.grbPrd.TabStop = False
        Me.grbPrd.Text = "请选择查询条件:"
        '
        'Label3
        '
        Me.Label3.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.Label3.ForeColor = System.Drawing.Color.Blue
        Me.Label3.Location = New System.Drawing.Point(35, 80)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(57, 24)
        Me.Label3.TabIndex = 11
        Me.Label3.Text = "关系:"
        '
        'Label2
        '
        Me.Label2.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.Label2.ForeColor = System.Drawing.Color.Blue
        Me.Label2.Location = New System.Drawing.Point(15, 124)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(97, 24)
        Me.Label2.TabIndex = 10
        Me.Label2.Text = "查询条件2:"
        '
        'txtVal2
        '
        Me.txtVal2.Location = New System.Drawing.Point(398, 122)
        Me.txtVal2.Name = "txtVal2"
        Me.txtVal2.Size = New System.Drawing.Size(112, 26)
        Me.txtVal2.TabIndex = 9
        Me.txtVal2.Text = ""
        '
        'txtVal1
        '
        Me.txtVal1.Location = New System.Drawing.Point(398, 35)
        Me.txtVal1.Name = "txtVal1"
        Me.txtVal1.Size = New System.Drawing.Size(112, 26)
        Me.txtVal1.TabIndex = 8
        Me.txtVal1.Text = ""
        '
        'cmbRel2
        '
        Me.cmbRel2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbRel2.Items.AddRange(New Object() {">=", ">", "=", "<=", "<", "<>"})
        Me.cmbRel2.Location = New System.Drawing.Point(254, 124)
        Me.cmbRel2.Name = "cmbRel2"
        Me.cmbRel2.Size = New System.Drawing.Size(112, 24)
        Me.cmbRel2.TabIndex = 7
        '
        'cmbField2
        '
        Me.cmbField2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbField2.Location = New System.Drawing.Point(120, 124)
        Me.cmbField2.Name = "cmbField2"
        Me.cmbField2.Size = New System.Drawing.Size(112, 24)
        Me.cmbField2.TabIndex = 6
        '
        'cmbRel3
        '
        Me.cmbRel3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbRel3.Items.AddRange(New Object() {"And", "Or"})
        Me.cmbRel3.Location = New System.Drawing.Point(254, 78)
        Me.cmbRel3.Name = "cmbRel3"
        Me.cmbRel3.Size = New System.Drawing.Size(112, 24)
        Me.cmbRel3.TabIndex = 5
        '
        'cmbRel1
        '
        Me.cmbRel1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbRel1.Items.AddRange(New Object() {">=", ">", "=", "<=", "<", "<>"})
        Me.cmbRel1.Location = New System.Drawing.Point(254, 37)
        Me.cmbRel1.Name = "cmbRel1"
        Me.cmbRel1.Size = New System.Drawing.Size(112, 24)
        Me.cmbRel1.TabIndex = 4
        '
        'cmbField1
        '
        Me.cmbField1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbField1.Location = New System.Drawing.Point(120, 37)
        Me.cmbField1.Name = "cmbField1"
        Me.cmbField1.Size = New System.Drawing.Size(112, 24)
        Me.cmbField1.TabIndex = 3
        '
        'Label1
        '
        Me.Label1.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.Label1.ForeColor = System.Drawing.Color.Blue
        Me.Label1.Location = New System.Drawing.Point(15, 37)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(97, 24)
        Me.Label1.TabIndex = 2
        Me.Label1.Text = "查询条件1:"
        '
        'btnFnd
        '
        Me.btnFnd.Font = New System.Drawing.Font("宋体", 15.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.btnFnd.ForeColor = System.Drawing.Color.Teal
        Me.btnFnd.Location = New System.Drawing.Point(104, 432)
        Me.btnFnd.Name = "btnFnd"
        Me.btnFnd.Size = New System.Drawing.Size(88, 40)
        Me.btnFnd.TabIndex = 26
        Me.btnFnd.Text = "查  找"
        '
        'btnPrt
        '
        Me.btnPrt.Font = New System.Drawing.Font("宋体", 15.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
        Me.btnPrt.ForeColor = System.Drawing.Color.Teal
        Me.btnPrt.Location = New System.Drawing.Point(312, 432)
        Me.btnPrt.Name = "btnPrt"
        Me.btnPrt.Size = New System.Drawing.Size(88, 40)
        Me.btnPrt.TabIndex = 28
        Me.btnPrt.Text = "打  印"
        '
        'frmFndPrd
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(794, 647)
        Me.Controls.Add(Me.btnPrt)
        Me.Controls.Add(Me.btnFnd)
        Me.Controls.Add(Me.btnExt)
        Me.Controls.Add(Me.dgdPrd)
        Me.Controls.Add(Me.grbPrd)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "frmFndPrd"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "查询商品资料"
        CType(Me.dgdPrd, System.ComponentModel.ISupportInitialize).EndInit()
        Me.grbPrd.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region
    'FndPrd类的对象
    Dim fndprdObj As New SCMAPP.FndPrd




    Private Sub frmFndPrd_Load(ByVal sender As System.Object, ByVal e As _
            System.EventArgs) Handles MyBase.Load
        '设置窗体内控件的大小和位置
        If Me.Width > 200 Then
            dgdPrd.Left = 5
            dgdPrd.Top = 0
            dgdPrd.Width = Me.Width - 5
            dgdPrd.Height = 3 * Me.Height / 4 - 90
            dgdPrd.RowHeaderWidth = 5
            dgdPrd.PreferredColumnWidth = (dgdPrd.Width - 10) / 7
            grbPrd.Left = 15
            grbPrd.Top = dgdPrd.Height + 15
            grbPrd.Width = Me.Width - 30
            grbPrd.Height = Me.Height / 4
            btnFnd.Top = dgdPrd.Height + grbPrd.Height + 25
            btnPrt.Top = dgdPrd.Height + grbPrd.Height + 25
            btnExt.Top = dgdPrd.Height + grbPrd.Height + 25
        End If
        '设置表格数据源
        dgdPrd.DataSource = fndprdObj.Refresh
        '为各个组合框添加子项
        cmbField1.Items.Add("商品编号")
        cmbField1.Items.Add("商品名称")
        cmbField1.Items.Add("商品类型")
        cmbField1.Items.Add("商品大小")
        cmbField1.Items.Add("商品净重")
        cmbField1.Items.Add("库存数量")
        cmbField1.Items.Add("商品说明")
        cmbField2.Items.Add("商品编号")
        cmbField2.Items.Add("商品名称")
        cmbField2.Items.Add("商品类型")
        cmbField2.Items.Add("商品大小")
        cmbField2.Items.Add("商品净重")
        cmbField2.Items.Add("库存数量")
        cmbField2.Items.Add("商品说明")
        '设置各个组合框缺省文本
        cmbField1.Text = "商品编号"
        cmbField2.Text = "商品名称"
        cmbRel1.Text = ">="
        cmbRel2.Text = ">="
        cmbRel3.Text = "And"
    End Sub





    Private Sub btnFnd_Click(ByVal sender As System.Object, ByVal e As _
            System.EventArgs) Handles btnFnd.Click
        dgdPrd.DataSource = fndprdObj.Fnd(cmbField1.Text, cmbRel1.Text, _
            Trim(txtVal1.Text), cmbRel3.Text, cmbField2.Text, _
            cmbRel2.Text, Trim(txtVal2.Text))
    End Sub


    Private Sub btnExt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExt.Click
        Me.Close()
    End Sub



    Private Sub btnPrt_Click(ByVal sender As System.Object, ByVal e As _
            System.EventArgs) Handles btnPrt.Click
        fndprdObj.Print()
    End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -