《部分VB程序代码费下载.doc》由会员分享,可在线阅读,更多相关《部分VB程序代码费下载.doc(5页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Public Class Form3 Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dim a As Form1 a = New Form1 a.Show() End SubEnd ClassPublic Class Form1 Inherits#Regi
2、on 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.Disp
3、ose() End If End If MyBase.Dispose(disposing) End Sub Windows 窗体设计器所必需的 Private components As 注意: 以下过程是Windows 窗体设计器所必需的 可以使用Windows 窗体设计器修改此过程。 不要使用代码编辑器修改它。 Friend WithEvents Label1 As Friend WithEvents TextBox2 As Friend WithEvents Button1 As Friend WithEvents SqlSelectCommand1 As Friend WithEven
4、ts SqlInsertCommand1 As Friend WithEvents SqlUpdateCommand1 As Friend WithEvents SqlDeleteCommand1 As Friend WithEvents SqlDataAdapter1 As Friend WithEvents Button2 As Friend WithEvents Label3 As Private Sub InitializeComponent() Me.Label1 = New Me.TextBox2 = New Me.Button1 = New Me.Label3 = New Me.
5、SqlSelectCommand1 = New Me.SqlInsertCommand1 = New Me.SqlUpdateCommand1 = New Me.SqlDeleteCommand1 = New Me.SqlDataAdapter1 = New Me.Button2 = New Me.SuspendLayout() Label1 Me.Label1.Font = New System.Drawing.Font(隶书, 18.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134
6、, Byte) Me Me.Label1.Location = New System.Drawing.Point(110, 31) Me.Label1.Name = Label1 Me.Label1.Size = New System.Drawing.Size(187, 56) Me.Label1.TabIndex = 0 Me.Label1.Text = 图书管理系统 TextBox2 Me.TextBox2.Location = New System.Drawing.Point(136, 112) Me.TextBox2.Name = TextBox2 Me.TextBox2.Passwo
7、rdChar = Global.Microsoft.VisualBasic.ChrW(42) Me.TextBox2.Size = New System.Drawing.Size(152, 29) Me.TextBox2.TabIndex = 4 Button1 Me.Button1.Font = New System.Drawing.Font(宋体, 10.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte) Me.Button1.Location = New System
8、.Drawing.Point(114, 203) Me.Button1.Name = Button1 Me.Button1.Size = New System.Drawing.Size(80, 31) Me.Button1.TabIndex = 5 Me.Button1.Text = 确定 Label3 Me Me.Label3.Font = New System.Drawing.Font(隶书, 18.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte) Me Me.Lab
9、el3.Location = New System.Drawing.Point(50, 112) Me.Label3.Name = Label3 Me.Label3.Size = New System.Drawing.Size(63, 38) Me.Label3.TabIndex = 2 Me.Label3.Text = 工号 SqlDataAdapter1 Me.SqlDataAdapter1.DeleteCommand = Me.SqlDeleteCommand1 Me.SqlDataAdapter1.InsertCommand = Me.SqlInsertCommand1 Me.SqlD
10、ataAdapter1.SelectCommand = Me.SqlSelectCommand1 Me.SqlDataAdapter1.UpdateCommand = Me.SqlUpdateCommand1 Button2 Me.Button2.Font = New System.Drawing.Font(宋体, 10.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte) Me.Button2.Location = New System.Drawing.Point(230,
11、 203) Me.Button2.Name = Button2 Me.Button2.Size = New System.Drawing.Size(80, 31) Me.Button2.TabIndex = 6 Me.Button2.Text = 返回 Me.Button2.UseVisualStyleBackColor = True Form1 Me.AutoScaleBaseSize = New System.Drawing.Size(10, 22) Me Me.ClientSize = New System.Drawing.Size(392, 286) Me.Controls.Add(M
12、e.Button2) Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.TextBox2) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label1) Me.Font = New System.Drawing.Font(宋体, 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte) Me.Name = Form1 Me.Text = 员工系统 Me.ResumeLayout(Fa
13、lse) Me.PerformLayout() End Sub#End Region Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles If TextBox2.Text = 0810811323 Or 0810811319 Then MessageBox.Show(账户正确, 提示信息, MessageBoxButtons.OK, MessageBoxIcon.Information) Dim a As Form2 a = New Form2 a.Show(
14、) Else MessageBox.Show(密码不正确,请重新输入, 提示信息, MessageBoxButtons.OK, MessageBoxIcon.Stop) End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dim a As Form3 a = New Form3 End Sub Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal
15、 e As System.EventArgs) Handles End SubEnd ClassImportsPublic Class Form2 Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dim cn As New SqlConn
16、ection(Initial Catalog=2; Data Source=(Local); _ & Integrated Security=SSPI; ) 定义数据库连接对象cn 定义满足要求的查询命令, 即查询指定学号的学生选课记录 Dim sql As String = Select * From book Where bookname= & TextBox1.Text & Dim ad As SqlDataAdapter = New SqlDataAdapter(sql, cn) 定义数据适配器对象ad Dim ds As New DataSet() 定义数据集对象ds ad.Fill
17、(ds, book) 将满足条件的查询结果填充到数据集中的表Grade DataGrid1.DataSource = ds.Tables(book) 为控件 DataGrid1指定显示的数据源 End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dim a As Form1 a = New Form1 a.Show() End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles End SubEnd Class
限制150内