📄 form3.vb
字号:
Public Class Form3
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 SqlDataAdapter1 As System.Data.SqlClient.SqlDataAdapter
Friend WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Friend WithEvents MSComm1 As AxMSCommLib.AxMSComm
Friend WithEvents Timer1 As System.Windows.Forms.Timer
Friend WithEvents SqlCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
Friend WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents SqlInsertCommand1 As System.Data.SqlClient.SqlCommand
Friend WithEvents DataSet11 As WindowsApplication2.DataSet1
Friend WithEvents Button5 As System.Windows.Forms.Button
Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents Timer2 As System.Windows.Forms.Timer
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form3))
Me.SqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter
Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
Me.MSComm1 = New AxMSCommLib.AxMSComm
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.SqlCommand1 = New System.Data.SqlClient.SqlCommand
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.Button5 = New System.Windows.Forms.Button
Me.ComboBox1 = New System.Windows.Forms.ComboBox
Me.Label5 = New System.Windows.Forms.Label
Me.Button4 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.TextBox3 = New System.Windows.Forms.TextBox
Me.Label1 = New System.Windows.Forms.Label
Me.Button2 = New System.Windows.Forms.Button
Me.Button1 = New System.Windows.Forms.Button
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Label4 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.GroupBox2 = New System.Windows.Forms.GroupBox
Me.Label6 = New System.Windows.Forms.Label
Me.DataGrid1 = New System.Windows.Forms.DataGrid
Me.DataSet11 = New WindowsApplication2.DataSet1
Me.TextBox4 = New System.Windows.Forms.TextBox
Me.Label7 = New System.Windows.Forms.Label
Me.Timer2 = New System.Windows.Forms.Timer(Me.components)
CType(Me.MSComm1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.GroupBox1.SuspendLayout()
Me.GroupBox2.SuspendLayout()
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'SqlDataAdapter1
'
Me.SqlDataAdapter1.InsertCommand = Me.SqlInsertCommand1
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
Me.SqlDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "食堂", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("IC卡号", "IC卡号"), New System.Data.Common.DataColumnMapping("姓名", "姓名"), New System.Data.Common.DataColumnMapping("余额", "余额"), New System.Data.Common.DataColumnMapping("用户类型", "用户类型")})})
'
'SqlInsertCommand1
'
Me.SqlInsertCommand1.CommandText = "INSERT INTO 食堂(IC卡号, 姓名, 余额, 用户类型) VALUES (@IC卡号, @姓名, @余额, @用户类型); SELECT IC卡号, " & _
"姓名, 余额, 用户类型 FROM 食堂"
Me.SqlInsertCommand1.Connection = Me.SqlConnection1
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@IC卡号", System.Data.SqlDbType.VarChar, 50, "IC卡号"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@姓名", System.Data.SqlDbType.VarChar, 50, "姓名"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@余额", System.Data.SqlDbType.VarChar, 50, "余额"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@用户类型", System.Data.SqlDbType.VarChar, 50, "用户类型"))
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "workstation id=697F107DEC5B46F;packet size=4096;integrated security=SSPI;data sou" & _
"rce=697F107DEC5B46F;persist security info=False;initial catalog=qishujia"
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "SELECT IC卡号, 姓名, 余额, 用户类型 FROM 食堂"
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
'
'MSComm1
'
Me.MSComm1.Enabled = True
Me.MSComm1.Location = New System.Drawing.Point(528, 8)
Me.MSComm1.Name = "MSComm1"
Me.MSComm1.OcxState = CType(resources.GetObject("MSComm1.OcxState"), System.Windows.Forms.AxHost.State)
Me.MSComm1.Size = New System.Drawing.Size(38, 38)
Me.MSComm1.TabIndex = 4
'
'Timer1
'
'
'GroupBox1
'
Me.GroupBox1.BackColor = System.Drawing.SystemColors.Control
Me.GroupBox1.Controls.Add(Me.Button5)
Me.GroupBox1.Controls.Add(Me.ComboBox1)
Me.GroupBox1.Controls.Add(Me.Label5)
Me.GroupBox1.Controls.Add(Me.Button4)
Me.GroupBox1.Controls.Add(Me.Button3)
Me.GroupBox1.Controls.Add(Me.TextBox3)
Me.GroupBox1.Controls.Add(Me.Label1)
Me.GroupBox1.Controls.Add(Me.Button2)
Me.GroupBox1.Controls.Add(Me.Button1)
Me.GroupBox1.Controls.Add(Me.TextBox2)
Me.GroupBox1.Controls.Add(Me.TextBox1)
Me.GroupBox1.Controls.Add(Me.Label4)
Me.GroupBox1.Controls.Add(Me.Label3)
Me.GroupBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.GroupBox1.ForeColor = System.Drawing.Color.Black
Me.GroupBox1.Location = New System.Drawing.Point(376, 56)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(216, 384)
Me.GroupBox1.TabIndex = 0
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "用户管理"
'
'Button5
'
Me.Button5.BackColor = System.Drawing.SystemColors.Control
Me.Button5.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Button5.Location = New System.Drawing.Point(56, 304)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(152, 35)
Me.Button5.TabIndex = 12
Me.Button5.Text = "显示所有(&S)"
'
'ComboBox1
'
Me.ComboBox1.BackColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(255, Byte), CType(255, Byte))
Me.ComboBox1.Items.AddRange(New Object() {"普通", "外来"})
Me.ComboBox1.Location = New System.Drawing.Point(104, 144)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(104, 33)
Me.ComboBox1.TabIndex = 11
'
'Label5
'
Me.Label5.BackColor = System.Drawing.SystemColors.Control
Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label5.Location = New System.Drawing.Point(0, 144)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(104, 32)
Me.Label5.TabIndex = 10
Me.Label5.Text = "用户类型"
'
'Button4
'
Me.Button4.BackColor = System.Drawing.SystemColors.Control
Me.Button4.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Button4.Location = New System.Drawing.Point(56, 264)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(152, 35)
Me.Button4.TabIndex = 9
Me.Button4.Text = "信息修改(&C)"
'
'Button3
'
Me.Button3.BackColor = System.Drawing.SystemColors.Control
Me.Button3.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Button3.Location = New System.Drawing.Point(56, 224)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(152, 35)
Me.Button3.TabIndex = 8
Me.Button3.Text = "删除用户(&D)"
'
'TextBox3
'
Me.TextBox3.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(192, Byte))
Me.TextBox3.Location = New System.Drawing.Point(104, 104)
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.Size = New System.Drawing.Size(104, 30)
Me.TextBox3.TabIndex = 7
Me.TextBox3.Text = ""
'
'Label1
'
Me.Label1.BackColor = System.Drawing.SystemColors.Control
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label1.Location = New System.Drawing.Point(8, 104)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(96, 32)
Me.Label1.TabIndex = 6
Me.Label1.Text = "余额"
'
'Button2
'
Me.Button2.BackColor = System.Drawing.SystemColors.Control
Me.Button2.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Button2.Location = New System.Drawing.Point(56, 344)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(152, 35)
Me.Button2.TabIndex = 5
Me.Button2.Text = "退出(&E)"
'
'Button1
'
Me.Button1.BackColor = System.Drawing.SystemColors.Control
Me.Button1.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Button1.Location = New System.Drawing.Point(56, 184)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(152, 35)
Me.Button1.TabIndex = 4
Me.Button1.Text = "添加用户(&A)"
'
'TextBox2
'
Me.TextBox2.BackColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(255, Byte), CType(255, Byte))
Me.TextBox2.Location = New System.Drawing.Point(104, 64)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(104, 30)
Me.TextBox2.TabIndex = 3
Me.TextBox2.Text = ""
'
'TextBox1
'
Me.TextBox1.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(192, Byte))
Me.TextBox1.Location = New System.Drawing.Point(104, 24)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(104, 30)
Me.TextBox1.TabIndex = 2
Me.TextBox1.Text = ""
'
'Label4
'
Me.Label4.BackColor = System.Drawing.SystemColors.Control
Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label4.Location = New System.Drawing.Point(8, 64)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(96, 32)
Me.Label4.TabIndex = 1
Me.Label4.Text = "姓名"
'
'Label3
'
Me.Label3.BackColor = System.Drawing.SystemColors.Control
Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label3.Location = New System.Drawing.Point(8, 24)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(96, 32)
Me.Label3.TabIndex = 0
Me.Label3.Text = "IC卡号"
'
'GroupBox2
'
Me.GroupBox2.BackColor = System.Drawing.SystemColors.Control
Me.GroupBox2.Controls.Add(Me.Label6)
Me.GroupBox2.Controls.Add(Me.DataGrid1)
Me.GroupBox2.Location = New System.Drawing.Point(16, 56)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(360, 384)
Me.GroupBox2.TabIndex = 1
Me.GroupBox2.TabStop = False
'
'Label6
'
Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.Label6.ForeColor = System.Drawing.Color.Blue
Me.Label6.Location = New System.Drawing.Point(24, 296)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(312, 56)
Me.Label6.TabIndex = 1
'
'DataGrid1
'
Me.DataGrid1.AlternatingBackColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(255, Byte), CType(255, Byte))
Me.DataGrid1.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(192, Byte))
Me.DataGrid1.BackgroundColor = System.Drawing.SystemColors.Desktop
Me.DataGrid1.CaptionBackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(192, Byte))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -