English 中文(简体)
标有一览表和图象的项目
原标题:Items icons with listview and imagelist

Hello I ve 提出一种清单观点,即把物品放在纸上,并展示。 我想知道,是否有办法让名单上的人看上去象,可能使用耳光32或图像清单。 该法典:

Imports System.IO
Imports System.Xml
Imports System.Runtime.InteropServices
Imports Microsoft.VisualBasic

Public Class cv7import

Private Sub cv7import_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim caminho As String
    caminho = "C:Documents and SettingsSoftwareAmbiente de trabalho1"



    lstvicon.View = View.Details
    lstvicon.GridLines = False
    lstvicon.FullRowSelect = True
    lstvicon.HideSelection = False
    lstvicon.MultiSelect = True


    lstvicon.Columns.Add("Nome")
    lstvicon.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize)

    Dim DI As System.IO.DirectoryInfo = New System.IO.DirectoryInfo(caminho)

    Dim files() As System.IO.FileInfo = DI.GetFiles

    Dim file As System.IO.FileInfo

    Dim li As ListViewItem
    For Each file In files
        li = lstvicon.Items.Add(file.Name)
        li.Tag = file.FullName
    Next
End Sub


End Class

这里有两幅形象,一是看它如何看待,一是想看它如何帮助。

我如何希望:http://imageshack.us/photo/my-images/21/wantd.png/

如何看待:

问题回答

<编码> ListViewItems have ImageList, ImageInd and ImageKey nature. 添加<代码>ImageList 控制权至(从工具箱中的部件组中)。 在选定图像清单时,你可以在<代码>ImageList上添加图像,在财产网下点击“图像”。 然后,将图像清单和图像指数或图像关键物列入清单。





相关问题
Is Shared ReadOnly lazyloaded?

I was wondering when I write Shared ReadOnly Variable As DataType = New DataType() Or alternatively Shared ReadOnly Variable As New DataType() Is it lazy loaded or as the instance initializes? ...

Entertaining a baby with VB.NET

I would like to write a little application in VB.NET that will detect a baby s cry. How would I get started with such an application?

Choose Enter Rather than Pressing Ok button

I have many fields in the page and the last field is a dropdown with list of values. When I select an item in a dropdown and press Enter, it doesn t do the "Ok". Instead I have to manually click on Ok ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

Set Select command in code

On button Click I want to Set the Select command of a Gridview. I do this and then databind the grid but it doesn t work. What am i doing wrong? protected void bttnView_Click(object sender, ...

Hover tooltip on specific words in rich text box?

I m trying to create something like a tooltip suddenly hoovering over the mouse pointer when specific words in the richt text box is hovered over. How can this be done?

热门标签