欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

frmqfa.vb

需要在.net环境下运行需要安装框架
VB
字号:
Public Class FRMQFA
    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 btnHID As System.Windows.Forms.Button
    Friend WithEvents btnFName As System.Windows.Forms.Button
    Friend WithEvents tbFName As System.Windows.Forms.TextBox
    Friend WithEvents nudHID As System.Windows.Forms.NumericUpDown
    Friend WithEvents DG As System.Windows.Forms.DataGrid
    Friend WithEvents btnAll As System.Windows.Forms.Button
    <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.btnHID = New System.Windows.Forms.Button()
        Me.btnFName = New System.Windows.Forms.Button()
        Me.tbFName = New System.Windows.Forms.TextBox()
        Me.nudHID = New System.Windows.Forms.NumericUpDown()
        Me.btnAll = New System.Windows.Forms.Button()
        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, 56)
        Me.DG.Name = "DG"
        Me.DG.Size = New System.Drawing.Size(592, 328)
        Me.DG.TabIndex = 0
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(8, 28)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(32, 16)
        Me.Label1.TabIndex = 1
        Me.Label1.Text = "房号"
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(188, 28)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(32, 16)
        Me.Label2.TabIndex = 2
        Me.Label2.Text = "姓名"
        '
        'btnHID
        '
        Me.btnHID.Location = New System.Drawing.Point(448, 24)
        Me.btnHID.Name = "btnHID"
        Me.btnHID.TabIndex = 3
        Me.btnHID.Text = "按房号查询"
        '
        'btnFName
        '
        Me.btnFName.Location = New System.Drawing.Point(523, 24)
        Me.btnFName.Name = "btnFName"
        Me.btnFName.TabIndex = 4
        Me.btnFName.Text = "按姓名查询"
        '
        'tbFName
        '
        Me.tbFName.Location = New System.Drawing.Point(236, 26)
        Me.tbFName.Name = "tbFName"
        Me.tbFName.TabIndex = 5
        Me.tbFName.Text = ""
        '
        'nudHID
        '
        Me.nudHID.Location = New System.Drawing.Point(56, 26)
        Me.nudHID.Name = "nudHID"
        Me.nudHID.Size = New System.Drawing.Size(96, 21)
        Me.nudHID.TabIndex = 6
        '
        'btnAll
        '
        Me.btnAll.Location = New System.Drawing.Point(376, 24)
        Me.btnAll.Name = "btnAll"
        Me.btnAll.TabIndex = 7
        Me.btnAll.Text = "查询全部"
        '
        'FRMQFA
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(608, 389)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnAll, Me.nudHID, Me.tbFName, Me.btnFName, Me.btnHID, Me.Label2, Me.Label1, Me.DG})
        Me.Name = "FRMQFA"
        Me.Text = "查询家庭成员"
        CType(Me.DG, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.nudHID, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub btnHID_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHID.Click
        '按房号查询
        Dim sqlStr As String = "select * from family where hID=" & nudHID.Text
        Dim dbopera1 As DbOpera = New DbOpera(sqlStr)
        DG.DataSource = dbopera1.getDG().DataSource
    End Sub

    Private Sub FRMQFA_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim sqlStr As String = "select * from family"
        Dim dbopera1 As DbOpera = New DbOpera(sqlStr)
        DG.DataSource = dbopera1.getDG().DataSource
        DG.NavigateTo(0, "marvin")
    End Sub

    Private Sub btnAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAll.Click
        Dim sqlStr As String = "select * from family"
        Dim dbopera1 As DbOpera = New DbOpera(sqlStr)
        DG.DataSource = dbopera1.getDG().DataSource
    End Sub

    Private Sub btnFName_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFName.Click
        Dim sqlStr As String = "select * from family where fName='" & tbFName.Text & "'"
        Dim dbopera1 As DbOpera = New DbOpera(sqlStr)
        DG.DataSource = dbopera1.getDG().DataSource
    End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -