Large Icon and small Icon for ListView
Imports System
Imports System.Data
Imports System.Windows.Forms
Imports System.Drawing
Imports System.Diagnostics
Public Class MainClass
Shared Sub Main()
Dim form1 As Form = New Form1
Application.Run(form1)
End Sub
End Class
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Public Class Form1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim ListViewItem1 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VB/XML", "2002", "503", "No"}, 0)
Dim ListViewItem2 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VBGP, 2e", "2000", "712", "Yes"}, 0)
Dim ListViewItem3 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VBA, 2e", "1998", "395", "Yes"}, 0)
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
Dim ListViewItem4 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VB/XML", "2002", "503", "No"}, 0)
Dim ListViewItem5 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VBGP, 2e", "2000", "712", "Yes"}, 0)
Dim ListViewItem6 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VBA, 2e", "1998", "395", "Yes"}, 0)
Dim ListViewItem7 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VB/XML", "2002", "503", "No"}, 0)
Dim ListViewItem8 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VBGP, 2e", "2000", "712", "Yes"}, 0)
Dim ListViewItem9 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VBA, 2e", "1998", "395", "Yes"}, 0)
Dim ListViewItem10 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VB/XML", "2002", "503", "No"}, 0)
Dim ListViewItem11 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VBGP, 2e", "2000", "712", "Yes"}, 0)
Dim ListViewItem12 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VBA, 2e", "1998", "395", "Yes"}, 0)
Dim ListViewItem13 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VB/XML", "2002", "503", "No"}, 0)
Dim ListViewItem14 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VBGP, 2e", "2000", "712", "Yes"}, 0)
Dim ListViewItem15 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VBA, 2e", "1998", "395", "Yes"}, 0)
Dim ListViewItem16 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VB/XML", "2002", "503", "No"}, 0)
Dim ListViewItem17 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VBGP, 2e", "2000", "712", "Yes"}, 0)
Dim ListViewItem18 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem(New String() {"VBA, 2e", "1998", "395", "Yes"}, 0)
Me.Label6 = New System.Windows.Forms.Label
Me.ListView1 = New System.Windows.Forms.ListView
Me.hdrTitle = New System.Windows.Forms.ColumnHeader
Me.hdrYear = New System.Windows.Forms.ColumnHeader
Me.hdrPages = New System.Windows.Forms.ColumnHeader
Me.hdrCd = New System.Windows.Forms.ColumnHeader
Me.imlBig = New System.Windows.Forms.ImageList(Me.components)
Me.imlSmall = New System.Windows.Forms.ImageList(Me.components)
Me.Label5 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label1 = New System.Windows.Forms.Label
Me.imlChecks = New System.Windows.Forms.ImageList(Me.components)
Me.ListView2 = New System.Windows.Forms.ListView
Me.ColumnHeader1 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader2 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader3 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader4 = New System.Windows.Forms.ColumnHeader
Me.ListView3 = New System.Windows.Forms.ListView
Me.ColumnHeader5 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader6 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader7 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader8 = New System.Windows.Forms.ColumnHeader
Me.ListView6 = New System.Windows.Forms.ListView
Me.ListView4 = New System.Windows.Forms.ListView
Me.ColumnHeader9 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader10 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader11 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader12 = New System.Windows.Forms.ColumnHeader
Me.ListView5 = New System.Windows.Forms.ListView
Me.SuspendLayout()
'
'Label6
'
Me.Label6.Location = New System.Drawing.Point(496, 184)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(240, 16)
Me.Label6.TabIndex = 27
Me.Label6.Text = "Tile"
Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'ListView1
'
Me.ListView1.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.hdrTitle, Me.hdrYear, Me.hdrPages, Me.hdrCd})
Me.ListView1.FullRowSelect = True
Me.ListView1.Items.AddRange(New System.Windows.Forms.ListViewItem() {ListViewItem1, ListViewItem2, ListViewItem3})
Me.ListView1.LargeImageList = Me.imlBig
Me.ListView1.Location = New System.Drawing.Point(0, 16)
Me.ListView1.Name = "ListView1"
Me.ListView1.Size = New System.Drawing.Size(240, 168)
Me.ListView1.SmallImageList = Me.imlSmall
Me.ListView1.TabIndex = 26
Me.ListView1.View = System.Windows.Forms.View.Details
'
'hdrTitle
'
Me.hdrTitle.Text = "Title"
Me.hdrTitle.Width = 100
'
'hdrYear
'
Me.hdrYear.Text = "Year"
Me.hdrYear.Width = 40
'
'hdrPages
'
Me.hdrPages.Text = "Pages"
Me.hdrPages.Width = 50
'
'hdrCd
'
Me.hdrCd.Text = "CD?"
Me.hdrCd.Width = 40
'
'imlBig
'
Me.imlBig.ImageStream = CType(resources.GetObject("imlBig.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.imlBig.Images.SetKeyName(0, "large_book.bmp")
'
'imlSmall
'
Me.imlSmall.ImageStream = CType(resources.GetObject("imlSmall.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.imlSmall.Images.SetKeyName(0, "small_book.bmp")
'
'Label5
'
Me.Label5.Location = New System.Drawing.Point(248, 184)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(240, 16)
Me.Label5.TabIndex = 22
Me.Label5.Text = "Tile"
Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(496, 0)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(240, 16)
Me.Label3.TabIndex = 21
Me.Label3.Text = "List"
Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label4
'
Me.Label4.Location = New System.Drawing.Point(0, 0)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(240, 16)
Me.Label4.TabIndex = 20
Me.Label4.Text = "Details"
Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(0, 184)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(240, 16)
Me.Label2.TabIndex = 19
Me.Label2.Text = "SmallIcon"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(248, 0)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(240, 16)
Me.Label1.TabIndex = 18
Me.Label1.Text = "LargeIcon"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'imlChecks
'
Me.imlChecks.ImageStream = CType(resources.GetObject("imlChecks.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.imlChecks.Images.SetKeyName(0, "Copy of 0.bmp")
Me.imlChecks.Images.SetKeyName(1, "Copy of 1.bmp")
Me.imlChecks.Images.SetKeyName(2, "Copy of 2.bmp")
Me.imlChecks.Images.SetKeyName(3, "Copy of 3.bmp")
'
'ListView2
'
Me.ListView2.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1, Me.ColumnHeader2, Me.ColumnHeader3, Me.ColumnHeader4})
Me.ListView2.FullRowSelect = True
Me.ListView2.Items.AddRange(New System.Windows.Forms.ListViewItem() {ListViewItem4, ListViewItem5, ListViewItem6})
Me.ListView2.LargeImageList = Me.imlBig
Me.ListView2.Location = New System.Drawing.Point(248, 16)
Me.ListView2.Name = "ListView2"
Me.ListView2.Size = New System.Drawing.Size(240, 168)
Me.ListView2.SmallImageList = Me.imlSmall
Me.ListView2.TabIndex = 28
'
'ColumnHeader1
'
Me.ColumnHeader1.Text = "Title"
Me.ColumnHeader1.Width = 100
'
'ColumnHeader2
'
Me.ColumnHeader2.Text = "Year"
Me.ColumnHeader2.Width = 40
'
'ColumnHeader3
'
Me.ColumnHeader3.Text = "Pages"
Me.ColumnHeader3.Width = 50
'
'ColumnHeader4
'
Me.ColumnHeader4.Text = "CD?"
Me.ColumnHeader4.Width = 40
'
'ListView3
'
Me.ListView3.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader5, Me.ColumnHeader6, Me.ColumnHeader7, Me.ColumnHeader8})
Me.ListView3.FullRowSelect = True
Me.ListView3.Items.AddRange(New System.Windows.Forms.ListViewItem() {ListViewItem7, ListViewItem8, ListViewItem9})
Me.ListView3.LargeImageList = Me.imlBig
Me.ListView3.Location = New System.Drawing.Point(496, 16)
Me.ListView3.Name = "ListView3"
Me.ListView3.Size = New System.Drawing.Size(240, 168)
Me.ListView3.SmallImageList = Me.imlSmall
Me.ListView3.TabIndex = 29
Me.ListView3.View = System.Windows.Forms.View.List
'
'ColumnHeader5
'
Me.ColumnHeader5.Text = "Title"
Me.ColumnHeader5.Width = 100
'
'ColumnHeader6
'
Me.ColumnHeader6.Text = "Year"
Me.ColumnHeader6.Width = 40
'
'ColumnHeader7
'
Me.ColumnHeader7.Text = "Pages"
Me.ColumnHeader7.Width = 50
'
'ColumnHeader8
'
Me.ColumnHeader8.Text = "CD?"
Me.ColumnHeader8.Width = 40
'
'ListView6
'
ListViewItem10.StateImageIndex = 0
ListViewItem11.Checked = True
ListViewItem11.StateImageIndex = 2
ListViewItem12.Checked = True
ListViewItem12.StateImageIndex = 3
Me.ListView6.Items.AddRange(New System.Windows.Forms.ListViewItem() {ListViewItem10, ListViewItem11, ListViewItem12})
Me.ListView6.LargeImageList = Me.imlBig
Me.ListView6.Location = New System.Drawing.Point(496, 200)
Me.ListView6.Name = "ListView6"
Me.ListView6.Size = New System.Drawing.Size(240, 168)
Me.ListView6.SmallImageList = Me.imlSmall
Me.ListView6.StateImageList = Me.imlChecks
Me.ListView6.TabIndex = 33
Me.ListView6.View = System.Windows.Forms.View.Tile
'
'ListView4
'
Me.ListView4.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader9, Me.ColumnHeader10, Me.ColumnHeader11, Me.ColumnHeader12})
Me.ListView4.FullRowSelect = True
Me.ListView4.Items.AddRange(New System.Windows.Forms.ListViewItem() {ListViewItem13, ListViewItem14, ListViewItem15})
Me.ListView4.LargeImageList = Me.imlBig
Me.ListView4.Location = New System.Drawing.Point(0, 200)
Me.ListView4.Name = "ListView4"
Me.ListView4.Size = New System.Drawing.Size(240, 168)
Me.ListView4.SmallImageList = Me.imlSmall
Me.ListView4.TabIndex = 34
Me.ListView4.View = System.Windows.Forms.View.SmallIcon
'
'ColumnHeader9
'
Me.ColumnHeader9.Text = "Title"
Me.ColumnHeader9.Width = 100
'
'ColumnHeader10
'
Me.ColumnHeader10.Text = "Year"
Me.ColumnHeader10.Width = 40
'
'ColumnHeader11
'
Me.ColumnHeader11.Text = "Pages"
Me.ColumnHeader11.Width = 50
'
'ColumnHeader12
'
Me.ColumnHeader12.Text = "CD?"
Me.ColumnHeader12.Width = 40
'
'ListView5
'
ListViewItem16.StateImageIndex = 0
ListViewItem17.Checked = True
ListViewItem17.StateImageIndex = 2
ListViewItem18.Checked = True
ListViewItem18.StateImageIndex = 3
Me.ListView5.Items.AddRange(New System.Windows.Forms.ListViewItem() {ListViewItem16, ListViewItem17, ListViewItem18})
Me.ListView5.LargeImageList = Me.imlBig
Me.ListView5.Location = New System.Drawing.Point(248, 200)
Me.ListView5.Name = "ListView5"
Me.ListView5.Size = New System.Drawing.Size(240, 168)
Me.ListView5.SmallImageList = Me.imlSmall
Me.ListView5.TabIndex = 35
Me.ListView5.View = System.Windows.Forms.View.Tile
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(736, 369)
Me.Controls.Add(Me.ListView5)
Me.Controls.Add(Me.ListView4)
Me.Controls.Add(Me.ListView6)
Me.Controls.Add(Me.ListView3)
Me.Controls.Add(Me.ListView2)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.ListView1)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Name = "Form1"
Me.Text = "UseListView"
Me.ResumeLayout(False)
End Sub
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents ListView1 As System.Windows.Forms.ListView
Friend WithEvents hdrTitle As System.Windows.Forms.ColumnHeader
Friend WithEvents hdrYear As System.Windows.Forms.ColumnHeader
Friend WithEvents hdrPages As System.Windows.Forms.ColumnHeader
Friend WithEvents hdrCd As System.Windows.Forms.ColumnHeader
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents imlBig As System.Windows.Forms.ImageList
Friend WithEvents imlSmall As System.Windows.Forms.ImageList
Friend WithEvents imlChecks As System.Windows.Forms.ImageList
Friend WithEvents ListView2 As System.Windows.Forms.ListView
Friend WithEvents ColumnHeader1 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader2 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader3 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader4 As System.Windows.Forms.ColumnHeader
Friend WithEvents ListView3 As System.Windows.Forms.ListView
Friend WithEvents ColumnHeader5 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader6 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader7 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader8 As System.Windows.Forms.ColumnHeader
Friend WithEvents ListView6 As System.Windows.Forms.ListView
Friend WithEvents ListView4 As System.Windows.Forms.ListView
Friend WithEvents ColumnHeader9 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader10 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader11 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader12 As System.Windows.Forms.ColumnHeader
Friend WithEvents ListView5 As System.Windows.Forms.ListView
End Class
Related examples in the same category