⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 listviewdemoform.vb

📁 Mastering VBNet Include Source Code
💻 VB
📖 第 1 页 / 共 2 页
字号:
        '
        'GroupBox2
        '
        Me.GroupBox2.Controls.AddRange(New System.Windows.Forms.Control() {Me.rdTop, Me.rdLeft, Me.rdDefault})
        Me.GroupBox2.Font = New System.Drawing.Font("Tahoma", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte))
        Me.GroupBox2.Location = New System.Drawing.Point(432, 160)
        Me.GroupBox2.Name = "GroupBox2"
        Me.GroupBox2.Size = New System.Drawing.Size(128, 112)
        Me.GroupBox2.TabIndex = 2
        Me.GroupBox2.TabStop = False
        Me.GroupBox2.Text = "Icon Placement"
        '
        'rdTop
        '
        Me.rdTop.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte))
        Me.rdTop.Location = New System.Drawing.Point(16, 88)
        Me.rdTop.Name = "rdTop"
        Me.rdTop.Size = New System.Drawing.Size(80, 16)
        Me.rdTop.TabIndex = 2
        Me.rdTop.Text = "Top"
        '
        'rdDefault
        '
        Me.rdDefault.Checked = True
        Me.rdDefault.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte))
        Me.rdDefault.Location = New System.Drawing.Point(16, 32)
        Me.rdDefault.Name = "rdDefault"
        Me.rdDefault.Size = New System.Drawing.Size(80, 16)
        Me.rdDefault.TabIndex = 0
        Me.rdDefault.TabStop = True
        Me.rdDefault.Text = "Default"
        '
        'bttnIterate
        '
        Me.bttnIterate.Font = New System.Drawing.Font("Tahoma", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte))
        Me.bttnIterate.Location = New System.Drawing.Point(432, 360)
        Me.bttnIterate.Name = "bttnIterate"
        Me.bttnIterate.Size = New System.Drawing.Size(128, 32)
        Me.bttnIterate.TabIndex = 3
        Me.bttnIterate.Text = "Selected Items"
        '
        'bttnPopulate
        '
        Me.bttnPopulate.Font = New System.Drawing.Font("Tahoma", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte))
        Me.bttnPopulate.Location = New System.Drawing.Point(432, 280)
        Me.bttnPopulate.Name = "bttnPopulate"
        Me.bttnPopulate.Size = New System.Drawing.Size(128, 32)
        Me.bttnPopulate.TabIndex = 3
        Me.bttnPopulate.Text = "Populate List"
        '
        'bttnEnumerate
        '
        Me.bttnEnumerate.Font = New System.Drawing.Font("Tahoma", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(161, Byte))
        Me.bttnEnumerate.Location = New System.Drawing.Point(432, 320)
        Me.bttnEnumerate.Name = "bttnEnumerate"
        Me.bttnEnumerate.Size = New System.Drawing.Size(128, 32)
        Me.bttnEnumerate.TabIndex = 3
        Me.bttnEnumerate.Text = "Enumerate List"
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(566, 397)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.bttnIterate, Me.bttnEnumerate, Me.bttnPopulate, Me.GroupBox2, Me.GroupBox1, Me.ListView1})
        Me.Name = "Form1"
        Me.Text = "ListView Demo"
        Me.GroupBox1.ResumeLayout(False)
        Me.GroupBox2.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    ' This project doesn't have a Load and Save command.
    ' You can copy all of the list's Items to an ArrayList and 
    ' persist it to a text file. Just create a Structure with a field
    ' for each SubItem, store each item to an instance of the custom Structure
    ' and then add all these variables to an ArrayList

    Private Sub rdDetails_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdDetails.CheckedChanged
        ListView1.View = View.Details
    End Sub

    Private Sub rdList_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdList.CheckedChanged
        ListView1.View = View.List
    End Sub

    Private Sub rdSmallIcons_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdSmallIcons.CheckedChanged
        ListView1.View = View.SmallIcon
    End Sub

    Private Sub rdIcons_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdIcons.CheckedChanged
        ListView1.View = View.LargeIcon
    End Sub

    Private Sub bttnPopulate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttnPopulate.Click
        Dim LItem As New ListViewItem()
        LItem.Text = "Alfreds Futterkiste"
        LItem.SubItems.Add("Anders Maria")
        LItem.SubItems.Add("030-0074321")
        LItem.SubItems.Add("030-0076545")
        LItem.ImageIndex = 0
        ListView1.Items.Add(LItem)

        LItem = New ListViewItem()
        LItem.Text = "Around the Horn"
        LItem.SubItems.Add("Hardy Thomas")
        LItem.SubItems.Add("(171) 555-7788")
        LItem.SubItems.Add("(171) 555-6750")
        LItem.ImageIndex = 0
        ListView1.Items.Add(LItem)

        LItem = New ListViewItem()
        LItem.Text = "Princesa Isabel Vinhos"
        LItem.SubItems.Add("de Castro Isabel")
        LItem.SubItems.Add("(1) 356-5634")
        LItem.SubItems.Add("")
        LItem.ImageIndex = 0
        ListView1.Items.Add(LItem)

        LItem = New ListViewItem()
        LItem.Text = "Furia Bacalhau e Frutos do Mar"
        LItem.SubItems.Add("Rodriguez Lino")
        LItem.SubItems.Add("(1) 354-2534")
        LItem.SubItems.Add("(1) 354-2535")
        LItem.ImageIndex = 0
        ListView1.Items.Add(LItem)

        LItem = New ListViewItem()
        LItem.Text = "Alfreds Futterkiste"
        LItem.SubItems.Add("Anders Maria")
        LItem.SubItems.Add("030-0074321")
        LItem.SubItems.Add("030-0076545")
        LItem.ImageIndex = 0
        ListView1.Items.Add(LItem)

        LItem = New ListViewItem()
        LItem.Text = "Around the Horn"
        LItem.SubItems.Add("Hardy Thomas")
        LItem.SubItems.Add("(171) 555-7788")
        LItem.SubItems.Add("(171) 555-6750")
        LItem.ImageIndex = 0
        ListView1.Items.Add(LItem)

        LItem = New ListViewItem()
        LItem.Text = "Bottom-Dollar Markets"
        LItem.SubItems.Add("Lincoln Elizabeth")
        LItem.SubItems.Add("(604) 555-4729")
        LItem.SubItems.Add("(604) 555-3745")
        LItem.ImageIndex = 0
        ListView1.Items.Add(LItem)

        LItem = New ListViewItem()
        LItem.Text = "Cactus Comidas para llevar"
        LItem.SubItems.Add("SimpsonPatricio")
        LItem.SubItems.Add("(1)135-5555")
        LItem.SubItems.Add("(1)135-4892")
        LItem.ImageIndex = 0
        ListView1.Items.Add(LItem)

        LItem = New ListViewItem()
        LItem.Text = "Eastern Connection"
        LItem.SubItems.Add("Devon Ann")
        LItem.SubItems.Add("(171) 555-0297")
        LItem.SubItems.Add("(171) 555-3373")
        LItem.ImageIndex = 0
        ListView1.Items.Add(LItem)

        LItem = New ListViewItem()
        LItem.Text = "Galer韆 del gastr髇omo"
        LItem.SubItems.Add("Saavedra Eduardo")
        LItem.SubItems.Add("(93) 203 4560")
        LItem.SubItems.Add("(93) 203 4561")
        LItem.ImageIndex = 0
        ListView1.Items.Add(LItem)

        LItem = New ListViewItem()
        LItem.Text = "Godos Cocina T韕ica"
        LItem.SubItems.Add("Freyre Jos

⌨️ 快捷键说明

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