📄 dzcx.vb
字号:
Public Class dzcx
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
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
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents Button5 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.Label2 = New System.Windows.Forms.Label
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.Button4 = New System.Windows.Forms.Button
Me.Label3 = New System.Windows.Forms.Label
Me.TextBox3 = New System.Windows.Forms.TextBox
Me.Button5 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(96, 72)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(48, 16)
Me.Label1.TabIndex = 0
Me.Label1.Text = "姓名"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(160, 64)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(176, 21)
Me.TextBox1.TabIndex = 1
Me.TextBox1.Text = ""
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(48, 160)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(64, 24)
Me.Button1.TabIndex = 2
Me.Button1.Text = "姓名查询"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(184, 160)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(64, 24)
Me.Button2.TabIndex = 3
Me.Button2.Text = "修改记录"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(248, 160)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(64, 24)
Me.Button3.TabIndex = 4
Me.Button3.Text = "删除记录"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(96, 112)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(40, 16)
Me.Label2.TabIndex = 5
Me.Label2.Text = "单位"
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(160, 104)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(176, 21)
Me.TextBox2.TabIndex = 6
Me.TextBox2.Text = ""
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(312, 160)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(64, 24)
Me.Button4.TabIndex = 7
Me.Button4.Text = "返 回"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(96, 32)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(56, 24)
Me.Label3.TabIndex = 8
Me.Label3.Text = "ID编号"
'
'TextBox3
'
Me.TextBox3.Location = New System.Drawing.Point(160, 24)
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.Size = New System.Drawing.Size(176, 21)
Me.TextBox3.TabIndex = 9
Me.TextBox3.Text = ""
'
'Button5
'
Me.Button5.Location = New System.Drawing.Point(112, 160)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(72, 24)
Me.Button5.TabIndex = 10
Me.Button5.Text = "添加记录"
'
'dzcx
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(442, 232)
Me.ControlBox = False
Me.Controls.Add(Me.Button5)
Me.Controls.Add(Me.TextBox3)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.Label1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
Me.Name = "dzcx"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "读者查询"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim str As String
str = "select * from borrower where xm='" & Trim(TextBox1.Text) & "'"
Call ReadMdb(str)
If DatRead.Read() Then
TextBox2.Text = DatRead(2).ToString
TextBox3.Text = DatRead(0).ToString
End If
DatRead.Close()
End Sub
Private Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
Me.Close()
End Sub
Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim str As String
str = "UPDATE borrower SET xm='" & Trim(TextBox1.Text) & "',jys='" & Trim(TextBox2.Text) & "'"
Call WriteMdb(str)
End Sub
Private Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim str As String
str = "DELETE FROM borrower"
Call WriteMdb(str)
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim str As String
str = "INSERT INTO borrower(xm,jys) VALUES('" & TextBox1.Text.ToString & "'," & "'" & TextBox2.Text.ToString & "')"
Call WriteMdb(str)
End Sub
Private Sub dzcx_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
CountItem = "数理系教工一览"
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -