frmqhowner.vb
字号:
Public Class FRMQHOWNER
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写处置以清理组件列表。
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 Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents tbHOName As System.Windows.Forms.TextBox
Friend WithEvents btnAll As System.Windows.Forms.Button
Friend WithEvents btnIF As System.Windows.Forms.Button
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents DG As System.Windows.Forms.DataGrid
Friend WithEvents nudHID As System.Windows.Forms.NumericUpDown
Friend WithEvents tbhoIDCard As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.DG = New System.Windows.Forms.DataGrid()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.tbHOName = New System.Windows.Forms.TextBox()
Me.btnAll = New System.Windows.Forms.Button()
Me.btnIF = New System.Windows.Forms.Button()
Me.Label3 = New System.Windows.Forms.Label()
Me.tbhoIDCard = New System.Windows.Forms.TextBox()
Me.nudHID = New System.Windows.Forms.NumericUpDown()
CType(Me.DG, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.nudHID, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'DG
'
Me.DG.DataMember = ""
Me.DG.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.DG.Location = New System.Drawing.Point(8, 48)
Me.DG.Name = "DG"
Me.DG.Size = New System.Drawing.Size(656, 320)
Me.DG.TabIndex = 0
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(8, 21)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(56, 16)
Me.Label1.TabIndex = 1
Me.Label1.Text = "房号:"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(168, 24)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(48, 16)
Me.Label2.TabIndex = 2
Me.Label2.Text = "姓名:"
'
'tbHOName
'
Me.tbHOName.Location = New System.Drawing.Point(224, 19)
Me.tbHOName.Name = "tbHOName"
Me.tbHOName.TabIndex = 4
Me.tbHOName.Text = ""
'
'btnAll
'
Me.btnAll.Location = New System.Drawing.Point(589, 17)
Me.btnAll.Name = "btnAll"
Me.btnAll.TabIndex = 5
Me.btnAll.Text = "查询全部"
'
'btnIF
'
Me.btnIF.Location = New System.Drawing.Point(520, 17)
Me.btnIF.Name = "btnIF"
Me.btnIF.TabIndex = 6
Me.btnIF.Text = "条件查询"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(336, 24)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(48, 16)
Me.Label3.TabIndex = 7
Me.Label3.Text = "证件:"
'
'tbhoIDCard
'
Me.tbhoIDCard.Location = New System.Drawing.Point(392, 19)
Me.tbhoIDCard.Name = "tbhoIDCard"
Me.tbhoIDCard.Size = New System.Drawing.Size(104, 21)
Me.tbhoIDCard.TabIndex = 8
Me.tbhoIDCard.Text = ""
'
'nudHID
'
Me.nudHID.Location = New System.Drawing.Point(48, 19)
Me.nudHID.Name = "nudHID"
Me.nudHID.TabIndex = 9
'
'FRMQHOWNER
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(672, 373)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.nudHID, Me.tbhoIDCard, Me.Label3, Me.btnIF, Me.btnAll, Me.tbHOName, Me.Label2, Me.Label1, Me.DG})
Me.Name = "FRMQHOWNER"
Me.Text = "FRMQHOWNER"
CType(Me.DG, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.nudHID, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private sqlStr As String
Private Sub FRMQHOWNER_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
sqlStr = "select * from houseOwner"
getInfo()
DG.NavigateTo(0, "marvin")
End Sub
Private Sub getInfo()
Dim dbopera1 As DbOpera = New DbOpera(sqlStr)
DG.DataSource = dbopera1.getDG().DataSource
End Sub
Private Sub btnAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAll.Click
sqlStr = "select * from houseOwner'"
getInfo()
End Sub
Private Sub btnIF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnIF.Click
If nudHID.Text = "" Then
If tbHOName.Text = "" Then
If tbhoIDCard.Text = "" Then
MsgBox("输入查询的条件!", MsgBoxStyle.Exclamation, "OK")
Exit Sub
Else
sqlStr = "select * from houseOwner where hoIDCard='" & tbhoIDCard.Text & "'"
getInfo()
Exit Sub
End If
Else
sqlStr = "select * from houseOwner where hoName='" & tbHOName.Text & "'"
getInfo()
Exit Sub
End If
Else
sqlStr = "select * from houseOwner where hID=" & nudHID.Text
getInfo()
Exit Sub
End If
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -