0

Is it possible to load image in first column (detail view) Listview from a file instead from ImageList's and how?

                Dim lvi As ListViewItem = New ListViewItem("Row1")
                With .Items.Add("0") '' PICTURE HERE IF POSSIBLE
                    .SubItems.Add("User name")
                    .SubItems.Add("Unactive")
                End With

Thanks.

4

1 回答 1

1

不,您必须“即时”制作图像列表。

类似的东西:-

    Dim ImageList As New ImageList

    Dim Lvi As New ListViewItem()
        ImageList.Images.Add(PictureBox1.Image, Color.White)
    With Lvi
        .Text = "Blah..."
        .ImageIndex = 0
    End With
    ListView1.Items.Add(Lvi)

(注意:没有测试代码,只是把它写在我的脑海中。)

于 2013-08-07T11:54:11.657 回答