Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

listview imagelist c#

        DirectoryInfo dir = new DirectoryInfo(@"c:myPicutures"); //change and get your folder
        foreach (FileInfo file in dir.GetFiles())
        {
            try
            {
                this.imageList1.Images.Add(Image.FromFile(file.FullName));
            }
            catch{
                Console.WriteLine("This is not an image file");
            }
        }
        this.listView1.View = View.LargeIcon;
        this.imageList1.ImageSize = new Size(32, 32);
        this.listView1.LargeImageList = this.imageList1;
        //or
        //this.listView1.View = View.SmallIcon;
        //this.listView1.SmallImageList = this.imageList1;

        for (int j = 0; j < this.imageList1.Images.Count; j++)
        {
            ListViewItem item = new ListViewItem();
            item.ImageIndex = j;
            this.listView1.Items.Add(item);
        }
Comment

PREVIOUS NEXT
Code Example
Csharp :: expansion tile 
Csharp :: c# how to append in array 
Csharp :: singleton pattern c# 
Csharp :: c# increment by 1 
Csharp :: add list to list c# 
Csharp :: sieve of eratosthenes 
Csharp :: ??= mean C# 
Csharp :: unity get max occurrence in list 
Csharp :: get file name from stream c# 
Csharp :: how to sort a dictionary by value in c# 
Csharp :: c# list remove by index 
Csharp :: async await c# 
Csharp :: math with c sharp 
Csharp :: string interpolation in c# 
Csharp :: c# array.reduce 
Csharp :: unity get audio clip length 
Csharp :: how to update model in entity framework db first approach 
Csharp :: ArgumentException: Input Key named: Fire1 is unknown 
Csharp :: superscript list 
Csharp :: c# group array based on first character 
Csharp :: unity DOScale 
Csharp :: concatanate two lists in c# 
Csharp :: how to check if a file is running in c# 
Csharp :: unity cannot click button 
Csharp :: c# on variable change property get set 
Csharp :: declare multiple variables in for loop C# 
Csharp :: browser folder in wpf 
Csharp :: .net core copy file in folder to root 
Csharp :: tachyons 
Csharp :: rigidbody.velocity.magnitude 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =