Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Extract filenames from a ImageList
Author:
Heinz Prelle
E-mail:
Click to e-mail author
Website:
http://www.visual-basic5.de
Submitted:
11/17/2008
Version:
VB 2008
Compatibility:
VB 2008
Category:
Forms
Views:
10841
This example extracts the filenames from a ImageList.
Declarations:
Option Explicit On Option Strict On
Code:
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles Button1.Click If (GetFilenamesInImageList(Me.ImageList1)) IsNot Nothing Then Me.ListBox1.Items.AddRange(GetFilenamesInImageList(Me.ImageList1).ToArray()) End If End Sub Private Function GetFilenamesInImageList(ByVal il As ImageList) As List(Of String) Dim List As New List(Of String) Dim Count As Integer = il.Images.Count() Try If Count > 0 Then For Each Filenames As String In il.Images.Keys List.Add(Filenames) Next Else List = Nothing End If Catch End Try Return List End Function Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles MyBase.Load With Me .CenterToScreen() .Text = "ImageList - Extract filenames" .Button1.Text = "Test" End With End Sub End Class
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement