ListView
ListView 컨트롤은 Visual Basic .NET(VB.NET)에서 사용하는 리스트 뷰 컨트롤입니다.
이 컨트롤은 항목의 목록을 표시하고, 사용자가 항목을 선택하고, 정렬하고, 그룹화하는 등의 기능을 제공합니다.
ListView1.View = View.LargeIcon
ListView1.View = View.Details
Source code
Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub Private Sub SetItems_Click(sender As Object, e As EventArgs) Handles SetItems.Click ListView1.Bounds = New Rectangle(New Point(10, 10), New Size(440, 262)) ListView1.FullRowSelect = True ListView1.LabelEdit = True ListView1.View = View.LargeIcon ListView1.AllowColumnReorder = True ListView1.GridLines = True ListView1.CheckBoxes = True ListView1.Sorting = SortOrder.Ascending ListView1.Columns.Add("Column1", 100, HorizontalAlignment.Left) ListView1.Columns.Add("Column2", 100, HorizontalAlignment.Center) ListView1.Columns.Add("Column3", 100, HorizontalAlignment.Center) ListView1.Columns.Add("Column4", 100, HorizontalAlignment.Center) Dim item1 As New ListViewItem("item1", 0) item1.Checked = False item1.SubItems.Add("1") item1.SubItems.Add("2") item1.SubItems.Add("3") 'ListView1.Items.Add(item1) ListView1.Items.Insert(0, item1) Dim item2 As New ListViewItem("item2", 1) item2.Checked = True item2.SubItems.Add("4") item2.SubItems.Add("5") item2.SubItems.Add("6") ListView1.Items.Add(item2) Dim item3 As New ListViewItem("item3", 0) item3.Checked = False item3.SubItems.Add("7") item3.SubItems.Add("8") item3.SubItems.Add("9") ListView1.Items.Add(item3) Dim imageListSmall As New ImageList() Dim imageListLarge As New ImageList() imageListSmall.Images.Add(Bitmap.FromFile("C:\Users\kims\Pictures\1.png")) imageListLarge.Images.Add(Bitmap.FromFile("C:\Users\kims\Pictures\2.png")) imageListLarge.Images.Add(Bitmap.FromFile("C:\Users\kims\Pictures\3.png")) imageListLarge.ImageSize = New Size(100, 100) ListView1.LargeImageList = imageListLarge ListView1.SmallImageList = imageListSmall End Sub Private Sub LargeIcon_Click(sender As Object, e As EventArgs) Handles LargeIcon.Click ListView1.View = View.LargeIcon End Sub Private Sub SmallIcon_Click(sender As Object, e As EventArgs) Handles SmallIcon.Click ListView1.View = View.SmallIcon End Sub Private Sub Details_Click_1(sender As Object, e As EventArgs) Handles Details.Click ListView1.View = View.Details End Sub End Class