📄 sellform.vb
字号:
Imports System.Data.SqlClient
Imports System.Runtime.Remoting
Public Class SellForm
'定义货物列表dataset
Dim Ds As DataSet
'定义出售货物类
Dim SellClass As ClassLibrary.SellClass
'
Dim GoodsDataRows As DataRow()
'定义当前文本框
Dim TB As TextBox
#Region " 说明代码 "
Private Sub SellFormNumberTextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormNumberTextBox.MouseEnter
'说明
SellFormExplainTextBox.Text = "输入货物编号"
End Sub
Private Sub SellFormNumberTextBox_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormNumberTextBox.MouseLeave
'说明
SellFormExplainTextBox.Text = ""
End Sub
Private Sub SellFormNameTextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormNameTextBox.MouseEnter
'说明
SellFormExplainTextBox.Text = "输入货物名称"
End Sub
Private Sub SellFormNameTextBox_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormNameTextBox.MouseLeave
'说明
SellFormExplainTextBox.Text = ""
End Sub
Private Sub SellFormGroupNumberTextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormGroupNumberTextBox.MouseEnter
'说明
SellFormExplainTextBox.Text = "货物所属类别编号"
End Sub
Private Sub SellFormGroupNumberTextBox_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormGroupNumberTextBox.MouseLeave
'说明
SellFormExplainTextBox.Text = ""
End Sub
Private Sub SellFormGroupTextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormGroupTextBox.MouseEnter
'说明
SellFormExplainTextBox.Text = "货物所属类别名称"
End Sub
Private Sub SellFormGroupTextBox_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormGroupTextBox.MouseLeave
'说明
SellFormExplainTextBox.Text = ""
End Sub
Private Sub SellFormNnitTextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormNnitTextBox.MouseEnter
'说明
SellFormExplainTextBox.Text = "货物单价"
End Sub
Private Sub SellFormNnitTextBox_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormNnitTextBox.MouseLeave
'说明
SellFormExplainTextBox.Text = ""
End Sub
Private Sub SellFormDanweiTextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormDanweiTextBox.MouseEnter
'说明
SellFormExplainTextBox.Text = "货物使用的计量单位"
End Sub
Private Sub SellFormDanweiTextBox_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormDanweiTextBox.MouseLeave
'说明
SellFormExplainTextBox.Text = ""
End Sub
Private Sub SellFormCountTextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormCountTextBox.MouseEnter
'说明
SellFormExplainTextBox.Text = "出售货物数量"
End Sub
Private Sub SellFormCountTextBox_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormCountTextBox.MouseLeave
'说明
SellFormExplainTextBox.Text = ""
End Sub
Private Sub SellFormSCountTextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormSCountTextBox.MouseEnter
'说明
SellFormExplainTextBox.Text = "出售货物库存数量"
End Sub
Private Sub SellFormSCountTextBox_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormSCountTextBox.MouseLeave
'说明
SellFormExplainTextBox.Text = ""
End Sub
Private Sub SellFormSellButton_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormSellButton.MouseEnter
'说明
SellFormExplainTextBox.Text = "出售货物"
End Sub
Private Sub SellFormSellButton_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormSellButton.MouseLeave
'说明
SellFormExplainTextBox.Text = ""
End Sub
Private Sub SellFormCancelButton_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormCancelButton.MouseEnter
'说明
SellFormExplainTextBox.Text = "清空"
End Sub
Private Sub SellFormCancelButton_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormCancelButton.MouseLeave
'说明
SellFormExplainTextBox.Text = ""
End Sub
Private Sub SellFormExitButton_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormExitButton.MouseEnter
'说明
SellFormExplainTextBox.Text = "退出窗体"
End Sub
Private Sub SellFormExitButton_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormExitButton.MouseLeave
'说明
SellFormExplainTextBox.Text = ""
End Sub
Private Sub SellFormHelpListBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormHelpListBox.MouseEnter
'说明
SellFormExplainTextBox.Text = "选择列表"
End Sub
Private Sub SellFormHelpListBox_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormHelpListBox.MouseLeave
'说明
SellFormExplainTextBox.Text = ""
End Sub
Private Sub SellFormDataGridView_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormDataGridView.MouseEnter
'说明
SellFormExplainTextBox.Text = "数据列表"
End Sub
Private Sub SellFormDataGridView_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellFormDataGridView.MouseLeave
'说明
SellFormExplainTextBox.Text = ""
End Sub
#End Region
#Region " 自定义代码 "
Private Sub ListDatarows(ByVal i As String)
'SellFormExplainTextBox.Text &= "0"
SellFormHelpListBox.Items.Clear()
'判断当前textbox控件
Dim NameTemp As String = Nothing
Dim NumberTemp As Short
Select Case TB.Name
Case SellFormNumberTextBox.Name
NameTemp = "number"
NumberTemp = 1
Case SellFormNameTextBox.Name
NameTemp = "name"
NumberTemp = 2
Case SellFormGroupNumberTextBox.Name
NameTemp = "groupnumber"
NumberTemp = 3
Case SellFormGroupTextBox.Name
NameTemp = "[group]"
NumberTemp = 4
End Select
'判断名称编号是否为空
If i <> "" Then
GoodsDataRows = Ds.Tables(0).Select(NameTemp & " like '" & i & "%'")
'判断找到数据是否为空
If GoodsDataRows.Length > 0 Then
Dim temp As Integer
'为列表添加数据
For temp = 0 To GoodsDataRows.Length - 1
SellFormHelpListBox.Items.Add(GoodsDataRows(temp)(NumberTemp))
Next
If GoodsDataRows.Length = 1 And i = Trim(SellFormHelpListBox.Items(0)) Then
Select Case TB.Name
Case SellFormNumberTextBox.Name
SellFormGroupNumberTextBox.Text = Trim(GoodsDataRows(0)(3))
SellFormGroupTextBox.Text = Trim(GoodsDataRows(0)(4))
SellFormDanweiTextBox.Text = Trim(GoodsDataRows(0)(5))
SellFormNnitTextBox.Text = Trim(GoodsDataRows(0)(6))
SellFormSCountTextBox.Text = Trim(GoodsDataRows(0)(7))
SellFormNameTextBox.Text = Trim(GoodsDataRows(0)(2))
Case SellFormNameTextBox.Name
SellFormGroupNumberTextBox.Text = Trim(GoodsDataRows(0)(3))
SellFormGroupTextBox.Text = Trim(GoodsDataRows(0)(4))
SellFormDanweiTextBox.Text = Trim(GoodsDataRows(0)(5))
SellFormNnitTextBox.Text = Trim(GoodsDataRows(0)(6))
SellFormSCountTextBox.Text = Trim(GoodsDataRows(0)(7))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -