vb.net列表显示的简单介绍

vb.net listview 显示数据问题Private Sub CreateMyListView()
' Create a new ListView control.
Dim listView1 As New ListView()
listView1.Bounds = New Rectangle(New Point(10, 10), New Size(300, 200))
' Set the view to show details.
listView1.View = View.Details
' Allow the user to edit item text.
listView1.LabelEdit = True
' Allow the user to rearrange columns.
listView1.AllowColumnReorder = True
' Display check boxes.
listView1.CheckBoxes = True
' Select the item and subitems when selection is made.
listView1.FullRowSelect = True
' Display grid lines.
listView1.GridLines = True
' Sort the items in the list in ascending order.
listView1.Sorting = SortOrder.Ascending
' Create three items and three sets of subitems for each item.
Dim item1 As New ListViewItem("item1", 0)
' Place a check mark next to the item.
item1.Checked = True
item1.SubItems.Add("1")
item1.SubItems.Add("2")
item1.SubItems.Add("3")
Dim item2 As New ListViewItem("item2", 1)
item2.SubItems.Add("4")
item2.SubItems.Add("5")
item2.SubItems.Add("6")
Dim item3 As New ListViewItem("item3", 0)
' Place a check mark next to the item.
item3.Checked = True
item3.SubItems.Add("7")
item3.SubItems.Add("8")
item3.SubItems.Add("9")
' Create columns for the items and subitems.
listView1.Columns.Add("Item Column", -2, HorizontalAlignment.Left)
listView1.Columns.Add("Column 2", -2, HorizontalAlignment.Left)
listView1.Columns.Add("Column 3", -2, HorizontalAlignment.Left)
listView1.Columns.Add("Column 4", -2, HorizontalAlignment.Center)
'Add the items to the ListView.
listView1.Items.AddRange(New ListViewItem() {item1, item2, item3})
' Create two ImageList objects.
Dim imageListSmall As New ImageList()
Dim imageListLarge As New ImageList()
' Initialize the ImageList objects with bitmaps.
imageListSmall.Images.Add(Bitmap.FromFile("C:\MySmallImage1.bmp"))
imageListSmall.Images.Add(Bitmap.FromFile("C:\MySmallImage2.bmp"))
imageListLarge.Images.Add(Bitmap.FromFile("C:\MyLargeImage1.bmp"))
imageListLarge.Images.Add(Bitmap.FromFile("C:\MyLargeImage2.bmp"))
'Assign the ImageList objects to the ListView.
listView1.LargeImageList = imageListLarge
listView1.SmallImageList = imageListSmall
' Add the ListView to the control collection.
Me.Controls.Add(listView1)
End Sub 'CreateMyListView
VB.NET大量数据列表化实时显示用什么控件比较好接收数据时vb.net列表显示,使用一个 Label 显示就行vb.net列表显示了 。而且跳过一些数据再显示,例如一秒钟才显示一个数据 。
你应该把精力放到领导(或者用户)vb.net列表显示的意图上,不要纠结技术上的 ListBox 。
vb.net中怎么把数据库中表的某一列显示在combobox中先测试不加入comboboxvb.net列表显示你能出多少行数据吧
For i = 0 To ds1.Tables.Count - 1
这句是不是应该写成这样
For i = 0 To ds1.Tables(0).Count - 1
没有实践过vb.net列表显示,说错请原谅
vb.net 显示列表问题先拖一个DataGridView到界面vb.net列表显示,然后代码里
Me.DataGridView1.DataSource = dt
vb.net列表显示图标 文字前面一个图标Public Class Form1
Private Imgfile As String
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ListBox1.DrawMode = DrawMode.OwnerDrawVariable
Imgfile = "X:\Users\......\Pictures\ssm.png"‘显示为listbox的每一行文字前面的图标文件,换一张你自己的图片 。
End Sub
Private Sub ListBox1_DrawItem(sender As Object, e As DrawItemEventArgs) Handles ListBox1.DrawItem
e.DrawBackground()
Dim rect As Rectangle = New Rectangle(2, e.Bounds.Y + 2, e.Bounds.Height, e.Bounds.Height - 4)

推荐阅读