Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

How to replace a listview's items with buttons?

$
0
0

'My apologies for using the coding space for this question,

my Galaxy Tab wouldn't recognise the "body" part of this question as a textbox and wouldn't open the keyboard. Anyway...quite frankly, the listview is ugly, so I would like to replace it. I've heard rumours on the internet that you can replace the listview with butttons. Is this possible? I am trying to create a user interface for the Pictures folder. Instead of using a listview to be populated with items from the pictures directory, I would like a button (140, 140) to be created for each picture item in the directory. The backgroundimage of each button would be the image of its associated file, and the button's text would be the name of the image file's name.

'I have here some code that accomplishes this for a listview, and I was wondering if I could implement something similar for what I am trying to achieve. Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load For Each I In My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.SpecialDirectories.MyPictures) Dim Picture_Icon_Add As System.Drawing.Icon = Icon.ExtractAssociatedIcon(I) ImageList1.Images.Add(Desktop_Icon_Add.ToBitmap) Listview1.Items.Add(I, ImageList1.Images.Count - 1) Next End Sub



Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>