tstform2.vb

来自「<Visual Basic 数据库开发实例精粹(第二版)>一书首先介」· VB 代码 · 共 344 行

VB
344
字号
Public Class tstform2
    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 Button1 As System.Windows.Forms.Button
  Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
  Friend WithEvents tlvMsg As System.Windows.Forms.TreeListView
  Friend WithEvents ColumnHeader1 As System.Windows.Forms.ColumnHeader
  Friend WithEvents ColumnHeader2 As System.Windows.Forms.ColumnHeader
  Friend WithEvents ImageList2 As System.Windows.Forms.ImageList
  Public WithEvents fraLogin As System.Windows.Forms.GroupBox
  Public WithEvents txtUser As System.Windows.Forms.TextBox
  Public WithEvents txtPwd As System.Windows.Forms.TextBox
  Public WithEvents cmdOK As System.Windows.Forms.Button
  Public WithEvents cmdExit As System.Windows.Forms.Button
  Public WithEvents picBG As System.Windows.Forms.Panel
  Public WithEvents _lblLogin_3 As System.Windows.Forms.Label
  Public WithEvents _lblLogin_1 As System.Windows.Forms.Label
  Public WithEvents _lblLogin_2 As System.Windows.Forms.Label
  Public WithEvents _lblLogin_0 As System.Windows.Forms.Label
  Public WithEvents _lblLogin_4 As System.Windows.Forms.Label
  Public WithEvents _lblLogin_5 As System.Windows.Forms.Label
  Public WithEvents imgloginLogo As System.Windows.Forms.PictureBox
  Public WithEvents _lblLogin_6 As System.Windows.Forms.Label
  Public WithEvents ToolTip1 As System.Windows.Forms.ToolTip
  <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.components = New System.ComponentModel.Container
    Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(tstform2))
    Me.Button1 = New System.Windows.Forms.Button
    Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
    Me.tlvMsg = New System.Windows.Forms.TreeListView
    Me.ColumnHeader1 = New System.Windows.Forms.ColumnHeader
    Me.ColumnHeader2 = New System.Windows.Forms.ColumnHeader
    Me.ImageList2 = New System.Windows.Forms.ImageList(Me.components)
    Me.fraLogin = New System.Windows.Forms.GroupBox
    Me.txtUser = New System.Windows.Forms.TextBox
    Me.txtPwd = New System.Windows.Forms.TextBox
    Me.cmdOK = New System.Windows.Forms.Button
    Me.cmdExit = New System.Windows.Forms.Button
    Me.picBG = New System.Windows.Forms.Panel
    Me._lblLogin_3 = New System.Windows.Forms.Label
    Me._lblLogin_1 = New System.Windows.Forms.Label
    Me._lblLogin_2 = New System.Windows.Forms.Label
    Me._lblLogin_0 = New System.Windows.Forms.Label
    Me._lblLogin_4 = New System.Windows.Forms.Label
    Me._lblLogin_5 = New System.Windows.Forms.Label
    Me.imgloginLogo = New System.Windows.Forms.PictureBox
    Me._lblLogin_6 = New System.Windows.Forms.Label
    Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
    Me.fraLogin.SuspendLayout()
    Me.picBG.SuspendLayout()
    Me.SuspendLayout()
    '
    'Button1
    '
    Me.Button1.Image = CType(resources.GetObject("Button1.Image"), System.Drawing.Image)
    Me.Button1.Location = New System.Drawing.Point(33, 333)
    Me.Button1.Name = "Button1"
    Me.Button1.Size = New System.Drawing.Size(86, 71)
    Me.Button1.TabIndex = 0
    Me.Button1.Text = "Button1"
    '
    'ImageList1
    '
    Me.ImageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit
    Me.ImageList1.ImageSize = New System.Drawing.Size(32, 32)
    Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
    Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
    '
    'tlvMsg
    '
    Me.tlvMsg.AllowColumnReorder = True
    Me.tlvMsg.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1, Me.ColumnHeader2})
    Me.tlvMsg.ExpandMethod = System.Windows.Forms.TreeListViewExpandMethod.IconDbleClick
    Me.tlvMsg.HideSelection = False
    Me.tlvMsg.LabelEdit = True
    Me.tlvMsg.Location = New System.Drawing.Point(254, 354)
    Me.tlvMsg.Name = "tlvMsg"
    Me.tlvMsg.Size = New System.Drawing.Size(245, 40)
    Me.tlvMsg.SmallImageList = Me.ImageList2
    Me.tlvMsg.TabIndex = 1
    '
    'ImageList2
    '
    Me.ImageList2.ImageSize = New System.Drawing.Size(16, 16)
    Me.ImageList2.ImageStream = CType(resources.GetObject("ImageList2.ImageStream"), System.Windows.Forms.ImageListStreamer)
    Me.ImageList2.TransparentColor = System.Drawing.Color.Transparent
    '
    'fraLogin
    '
    Me.fraLogin.BackColor = System.Drawing.SystemColors.Control
    Me.fraLogin.Controls.Add(Me.txtUser)
    Me.fraLogin.Controls.Add(Me.txtPwd)
    Me.fraLogin.Controls.Add(Me.cmdOK)
    Me.fraLogin.Controls.Add(Me.cmdExit)
    Me.fraLogin.Controls.Add(Me.picBG)
    Me.fraLogin.Controls.Add(Me._lblLogin_4)
    Me.fraLogin.Controls.Add(Me._lblLogin_5)
    Me.fraLogin.Controls.Add(Me.imgloginLogo)
    Me.fraLogin.Controls.Add(Me._lblLogin_6)
    Me.fraLogin.FlatStyle = System.Windows.Forms.FlatStyle.Popup
    Me.fraLogin.ForeColor = System.Drawing.SystemColors.ControlText
    Me.fraLogin.Location = New System.Drawing.Point(12, 19)
    Me.fraLogin.Name = "fraLogin"
    Me.fraLogin.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.fraLogin.Size = New System.Drawing.Size(501, 320)
    Me.fraLogin.TabIndex = 6
    Me.fraLogin.TabStop = False
    '
    'txtUser
    '
    Me.txtUser.AcceptsReturn = True
    Me.txtUser.AutoSize = False
    Me.txtUser.BackColor = System.Drawing.SystemColors.Window
    Me.txtUser.Cursor = System.Windows.Forms.Cursors.IBeam
    Me.txtUser.ForeColor = System.Drawing.SystemColors.WindowText
    Me.txtUser.Location = New System.Drawing.Point(124, 120)
    Me.txtUser.MaxLength = 0
    Me.txtUser.Name = "txtUser"
    Me.txtUser.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.txtUser.Size = New System.Drawing.Size(174, 22)
    Me.txtUser.TabIndex = 2
    Me.txtUser.Text = "Admin"
    '
    'txtPwd
    '
    Me.txtPwd.AcceptsReturn = True
    Me.txtPwd.AutoSize = False
    Me.txtPwd.BackColor = System.Drawing.SystemColors.Window
    Me.txtPwd.Cursor = System.Windows.Forms.Cursors.IBeam
    Me.txtPwd.ForeColor = System.Drawing.SystemColors.WindowText
    Me.txtPwd.Location = New System.Drawing.Point(124, 152)
    Me.txtPwd.MaxLength = 0
    Me.txtPwd.Name = "txtPwd"
    Me.txtPwd.PasswordChar = Microsoft.VisualBasic.ChrW(42)
    Me.txtPwd.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.txtPwd.Size = New System.Drawing.Size(174, 22)
    Me.txtPwd.TabIndex = 3
    Me.txtPwd.Text = "Admin"
    Me.ToolTip1.SetToolTip(Me.txtPwd, "请输入密码")
    '
    'cmdOK
    '
    Me.cmdOK.BackColor = System.Drawing.SystemColors.Control
    Me.cmdOK.Cursor = System.Windows.Forms.Cursors.Default
    Me.cmdOK.ForeColor = System.Drawing.SystemColors.ControlText
    Me.cmdOK.Location = New System.Drawing.Point(96, 184)
    Me.cmdOK.Name = "cmdOK"
    Me.cmdOK.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.cmdOK.Size = New System.Drawing.Size(84, 25)
    Me.cmdOK.TabIndex = 0
    Me.cmdOK.Text = "登录(&O)"
    Me.ToolTip1.SetToolTip(Me.cmdOK, "登录")
    '
    'cmdExit
    '
    Me.cmdExit.BackColor = System.Drawing.SystemColors.Control
    Me.cmdExit.Cursor = System.Windows.Forms.Cursors.Default
    Me.cmdExit.DialogResult = System.Windows.Forms.DialogResult.Cancel
    Me.cmdExit.ForeColor = System.Drawing.SystemColors.ControlText
    Me.cmdExit.Location = New System.Drawing.Point(196, 184)
    Me.cmdExit.Name = "cmdExit"
    Me.cmdExit.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.cmdExit.Size = New System.Drawing.Size(84, 25)
    Me.cmdExit.TabIndex = 4
    Me.cmdExit.Text = "退出(&E)"
    '
    'picBG
    '
    Me.picBG.BackColor = System.Drawing.Color.FromArgb(CType(128, Byte), CType(128, Byte), CType(128, Byte))
    Me.picBG.Controls.Add(Me._lblLogin_3)
    Me.picBG.Controls.Add(Me._lblLogin_1)
    Me.picBG.Controls.Add(Me._lblLogin_2)
    Me.picBG.Controls.Add(Me._lblLogin_0)
    Me.picBG.Cursor = System.Windows.Forms.Cursors.Default
    Me.picBG.ForeColor = System.Drawing.SystemColors.WindowText
    Me.picBG.Location = New System.Drawing.Point(2, 9)
    Me.picBG.Name = "picBG"
    Me.picBG.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.picBG.Size = New System.Drawing.Size(417, 95)
    Me.picBG.TabIndex = 5
    '
    '_lblLogin_3
    '
    Me._lblLogin_3.AutoSize = True
    Me._lblLogin_3.BackColor = System.Drawing.Color.Transparent
    Me._lblLogin_3.Cursor = System.Windows.Forms.Cursors.Default
    Me._lblLogin_3.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
    Me._lblLogin_3.ForeColor = System.Drawing.Color.White
    Me._lblLogin_3.Location = New System.Drawing.Point(50, 38)
    Me._lblLogin_3.Name = "_lblLogin_3"
    Me._lblLogin_3.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me._lblLogin_3.Size = New System.Drawing.Size(252, 25)
    Me._lblLogin_3.TabIndex = 6
    Me._lblLogin_3.Text = "企业内部办公联系系统 V2.0"
    '
    '_lblLogin_1
    '
    Me._lblLogin_1.AutoSize = True
    Me._lblLogin_1.BackColor = System.Drawing.Color.Transparent
    Me._lblLogin_1.Cursor = System.Windows.Forms.Cursors.Default
    Me._lblLogin_1.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
    Me._lblLogin_1.ForeColor = System.Drawing.SystemColors.ControlText
    Me._lblLogin_1.Location = New System.Drawing.Point(14, 12)
    Me._lblLogin_1.Name = "_lblLogin_1"
    Me._lblLogin_1.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me._lblLogin_1.Size = New System.Drawing.Size(63, 19)
    Me._lblLogin_1.TabIndex = 9
    Me._lblLogin_1.Text = "欢迎使用"
    '
    '_lblLogin_2
    '
    Me._lblLogin_2.AutoSize = True
    Me._lblLogin_2.BackColor = System.Drawing.Color.Transparent
    Me._lblLogin_2.Cursor = System.Windows.Forms.Cursors.Default
    Me._lblLogin_2.ForeColor = System.Drawing.SystemColors.ControlText
    Me._lblLogin_2.Location = New System.Drawing.Point(167, 74)
    Me._lblLogin_2.Name = "_lblLogin_2"
    Me._lblLogin_2.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me._lblLogin_2.Size = New System.Drawing.Size(208, 17)
    Me._lblLogin_2.TabIndex = 8
    Me._lblLogin_2.Text = "版权所有 (C) 2005-2008 特瑞飞软件"
    '
    '_lblLogin_0
    '
    Me._lblLogin_0.AutoSize = True
    Me._lblLogin_0.BackColor = System.Drawing.Color.Transparent
    Me._lblLogin_0.Cursor = System.Windows.Forms.Cursors.Default
    Me._lblLogin_0.Font = New System.Drawing.Font("宋体", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
    Me._lblLogin_0.ForeColor = System.Drawing.Color.Black
    Me._lblLogin_0.Location = New System.Drawing.Point(52, 40)
    Me._lblLogin_0.Name = "_lblLogin_0"
    Me._lblLogin_0.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me._lblLogin_0.Size = New System.Drawing.Size(203, 25)
    Me._lblLogin_0.TabIndex = 7
    Me._lblLogin_0.Text = "企业内部信息管理系统"
    '
    '_lblLogin_4
    '
    Me._lblLogin_4.AutoSize = True
    Me._lblLogin_4.BackColor = System.Drawing.Color.Transparent
    Me._lblLogin_4.Cursor = System.Windows.Forms.Cursors.Default
    Me._lblLogin_4.ForeColor = System.Drawing.SystemColors.ControlText
    Me._lblLogin_4.Location = New System.Drawing.Point(64, 120)
    Me._lblLogin_4.Name = "_lblLogin_4"
    Me._lblLogin_4.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me._lblLogin_4.Size = New System.Drawing.Size(42, 17)
    Me._lblLogin_4.TabIndex = 12
    Me._lblLogin_4.Text = "用户名"
    '
    '_lblLogin_5
    '
    Me._lblLogin_5.AutoSize = True
    Me._lblLogin_5.BackColor = System.Drawing.Color.Transparent
    Me._lblLogin_5.Cursor = System.Windows.Forms.Cursors.Default
    Me._lblLogin_5.ForeColor = System.Drawing.SystemColors.ControlText
    Me._lblLogin_5.Location = New System.Drawing.Point(52, 152)
    Me._lblLogin_5.Name = "_lblLogin_5"
    Me._lblLogin_5.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me._lblLogin_5.Size = New System.Drawing.Size(54, 17)
    Me._lblLogin_5.TabIndex = 11
    Me._lblLogin_5.Text = "登录密码"
    '
    'imgloginLogo
    '
    Me.imgloginLogo.Cursor = System.Windows.Forms.Cursors.Default
    Me.imgloginLogo.Image = CType(resources.GetObject("imgloginLogo.Image"), System.Drawing.Image)
    Me.imgloginLogo.Location = New System.Drawing.Point(320, 120)
    Me.imgloginLogo.Name = "imgloginLogo"
    Me.imgloginLogo.Size = New System.Drawing.Size(84, 93)
    Me.imgloginLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
    Me.imgloginLogo.TabIndex = 13
    Me.imgloginLogo.TabStop = False
    '
    '_lblLogin_6
    '
    Me._lblLogin_6.AutoSize = True
    Me._lblLogin_6.BackColor = System.Drawing.Color.Transparent
    Me._lblLogin_6.Cursor = System.Windows.Forms.Cursors.Default
    Me._lblLogin_6.ForeColor = System.Drawing.Color.FromArgb(CType(0, Byte), CType(0, Byte), CType(192, Byte))
    Me._lblLogin_6.Location = New System.Drawing.Point(72, 224)
    Me._lblLogin_6.Name = "_lblLogin_6"
    Me._lblLogin_6.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me._lblLogin_6.Size = New System.Drawing.Size(227, 17)
    Me._lblLogin_6.TabIndex = 10
    Me._lblLogin_6.Text = "注:默认登录用户:密码 是 Admin:Admin"
    '
    'tstform2
    '
    Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
    Me.ClientSize = New System.Drawing.Size(531, 407)
    Me.Controls.Add(Me.tlvMsg)
    Me.Controls.Add(Me.Button1)
    Me.Controls.Add(Me.fraLogin)
    Me.Name = "tstform2"
    Me.Text = "tstform2"
    Me.fraLogin.ResumeLayout(False)
    Me.picBG.ResumeLayout(False)
    Me.ResumeLayout(False)

  End Sub

#End Region

  Private Sub tstform2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim root, folder1 As TreeListViewItem

    root = tlvMsg.Items.Add("root")
    folder1 = root.Items.Add("folder1")
    folder1 = root.Items.Add("folder2")
    folder1 = root.Items.Add("folder3")



  End Sub
End Class

⌨️ 快捷键说明

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