|
-
Dec 13th, 2007, 02:50 PM
#1
[2005] Fill a combobox with the names of a imagelist imagesnames.
Hi All,
I didn't found something about that subject.
Like the question says.
I want to fill a combobox with the Imagesnames from a imagelist.
How can I do that?
This is already a part of my app.
When I fill my combobox manually then I call the image like this:
Code:
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
PictureBox1.Image = (ImageList1.Images(ComboBox1.SelectedItem & ".jpg"))
End Sub
That's working very good, but how should I do the other part.
Thanks,
sparrow1
-
Dec 13th, 2007, 03:06 PM
#2
Fanatic Member
Re: [2005] Fill a combobox with the names of a imagelist imagesnames.
Part of the problem is that the file is loaded as a resource when it is added to your imagelist.
If you want the filename of the file itself, don't use an image list. Instead, just store all of the file in a special folder in your app. Then, use the File.IO to get the files:
vb Code:
Dim strFiles() As String = System.IO.Directory.GetFiles("path")
Loop through for all the file names and add them to the combobox
Warren Ayen
Senior C# Developer
DLS Software Studios ( http://www.dlssoftwarestudios.com/)
I use Microsoft Visual Studio 2005, 2008, working with Visual Basic and Visual C#
Hey! If you like my post, or I solve your issue, please Rate Me!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|