How to change icon size in listview runtime?

Y

yxq

Hi,
I write the code to change icon size in listview, but so as the Trackbar
value changed, the icons will disappear, but the text is eyeable.

**********************************************
'Trackbar1 max value is 6
'Trackbar1 min value is 2

Private Sub Trackbar1_ValueChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Trackbar1.ValueChanged
ImageList1.ImageSize = New Size(Trackbar1.Value * 8, Trackbar1.Value
* 8)
ListView1.LargeImageList = ImageList1
ListView1.Items(0).ImageIndex = 0
ListView1.Items(1).ImageIndex = 1
ListView1.Items(2).ImageIndex = 2
Application.DoEvents()
ListView1.Refresh()
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top