📄 frminquirestinfo.vb
字号:
Imports System.Data.SqlClient
Public Class frminquirestinfo
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 GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents combosearchtype As System.Windows.Forms.ComboBox
Friend WithEvents txtsearchvalue As System.Windows.Forms.TextBox
Friend WithEvents btinquire As System.Windows.Forms.Button
Friend WithEvents btexit As System.Windows.Forms.Button
Friend WithEvents dgstinfo As System.Windows.Forms.DataGrid
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.btexit = New System.Windows.Forms.Button
Me.btinquire = New System.Windows.Forms.Button
Me.txtsearchvalue = New System.Windows.Forms.TextBox
Me.combosearchtype = New System.Windows.Forms.ComboBox
Me.Label2 = New System.Windows.Forms.Label
Me.Label1 = New System.Windows.Forms.Label
Me.dgstinfo = New System.Windows.Forms.DataGrid
Me.GroupBox1.SuspendLayout()
CType(Me.dgstinfo, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.btexit)
Me.GroupBox1.Controls.Add(Me.btinquire)
Me.GroupBox1.Controls.Add(Me.txtsearchvalue)
Me.GroupBox1.Controls.Add(Me.combosearchtype)
Me.GroupBox1.Controls.Add(Me.Label2)
Me.GroupBox1.Controls.Add(Me.Label1)
Me.GroupBox1.Location = New System.Drawing.Point(8, 16)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(384, 104)
Me.GroupBox1.TabIndex = 0
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "查询学籍信息"
'
'btexit
'
Me.btexit.Location = New System.Drawing.Point(288, 64)
Me.btexit.Name = "btexit"
Me.btexit.TabIndex = 5
Me.btexit.Text = "退出查询"
'
'btinquire
'
Me.btinquire.Location = New System.Drawing.Point(200, 64)
Me.btinquire.Name = "btinquire"
Me.btinquire.Size = New System.Drawing.Size(72, 23)
Me.btinquire.TabIndex = 4
Me.btinquire.Text = "查询"
'
'txtsearchvalue
'
Me.txtsearchvalue.Location = New System.Drawing.Point(96, 64)
Me.txtsearchvalue.Name = "txtsearchvalue"
Me.txtsearchvalue.Size = New System.Drawing.Size(72, 21)
Me.txtsearchvalue.TabIndex = 3
Me.txtsearchvalue.Text = ""
'
'combosearchtype
'
Me.combosearchtype.Items.AddRange(New Object() {"StudentID", "Name", "Sex", "BirthDate", "ClassID", "Tel", "Rdate", "Address"})
Me.combosearchtype.Location = New System.Drawing.Point(16, 64)
Me.combosearchtype.Name = "combosearchtype"
Me.combosearchtype.Size = New System.Drawing.Size(64, 20)
Me.combosearchtype.TabIndex = 2
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(96, 32)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(56, 23)
Me.Label2.TabIndex = 1
Me.Label2.Text = "查询条件"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(8, 32)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(56, 23)
Me.Label1.TabIndex = 0
Me.Label1.Text = "查询方式"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'dgstinfo
'
Me.dgstinfo.DataMember = ""
Me.dgstinfo.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.dgstinfo.Location = New System.Drawing.Point(8, 128)
Me.dgstinfo.Name = "dgstinfo"
Me.dgstinfo.Size = New System.Drawing.Size(384, 136)
Me.dgstinfo.TabIndex = 1
'
'frminquirestinfo
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(400, 273)
Me.Controls.Add(Me.dgstinfo)
Me.Controls.Add(Me.GroupBox1)
Me.Name = "frminquirestinfo"
Me.Text = "frminquirestinfo"
Me.GroupBox1.ResumeLayout(False)
CType(Me.dgstinfo, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub frminquirestinfo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub btinquire_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btinquire.Click
Dim tablename As String = "student"
searchsql = "select * from student where " & combosearchtype.Text.Trim & "='" & txtsearchvalue.Text.Trim & "'"
MsgBox(searchsql)
Module1.executesql(searchsql, tablename)
dgstinfo.DataSource = Module1.ds.Tables.Item(0).DefaultView
End Sub
Private Sub btexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btexit.Click
Me.Close()
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -