Lost Password?


Go Back   CodeCall Programming Forum > Software Development > Visual Basic Programming

Visual Basic Programming Discussion forum for Visual Basic, an event driven programming language and associated development environment from Microsoft for its COM programming model.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-28-2008, 03:11 PM
wazofski wazofski is offline
Programmer
 
Join Date: Feb 2008
Posts: 126
Rep Power: 3
wazofski is on a distinguished road
Default Image List

How do I add Images to a listbox? So if you press the name in the listbox of the picture it will be shown in a picturebox
I use vb 2008
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 07-28-2008, 03:23 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,897
Last Blog:
Web slideshow in JavaS...
Rep Power: 78
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Image List

Aha. Use an ImageList. Add one to the project, then add the images using the Properties panel. Then, you can use code such as ImageList1.Images(0) to set to the picturebox's Image property.
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-28-2008, 03:29 PM
wazofski wazofski is offline
Programmer
 
Join Date: Feb 2008
Posts: 126
Rep Power: 3
wazofski is on a distinguished road
Default Re: Image List

I got the imagelist, and could you tell more specific how to add the images to the list?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-28-2008, 03:30 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,897
Last Blog:
Web slideshow in JavaS...
Rep Power: 78
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Image List

First, change the ImageSize or something named like that, to stop it resizing images. Then, click on the Images property, click the small button labelled "...", and add images from the window that appears.
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-28-2008, 03:38 PM
wazofski wazofski is offline
Programmer
 
Join Date: Feb 2008
Posts: 126
Rep Power: 3
wazofski is on a distinguished road
Default Re: Image List

ok and how do I add the image to the picturebox?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 07-28-2008, 03:47 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,897
Last Blog:
Web slideshow in JavaS...
Rep Power: 78
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Image List

Well, like this:

vb Code:
  1. Dim index As Integer = 2
  2. PictureBox1.Image = ImageList1.Images(index)

This code sets the third image in the list to the picturebox (because arrays are zero-based).
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 07-28-2008, 03:51 PM
wazofski wazofski is offline
Programmer
 
Join Date: Feb 2008
Posts: 126
Rep Power: 3
wazofski is on a distinguished road
Default Re: Image List

thx, one more problem the imagelist resizes the images how do i turn it off?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 07-28-2008, 03:52 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,897
Last Blog:
Web slideshow in JavaS...
Rep Power: 78
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Image List

Yeah, I get that sometimes. Did you set the ImageSize property first on the ImageList?
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 07-28-2008, 03:55 PM
wazofski wazofski is offline
Programmer
 
Join Date: Feb 2008
Posts: 126
Rep Power: 3
wazofski is on a distinguished road
Default Re: Image List

The image size was automaticly set on 32;32 (image list)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 07-28-2008, 03:56 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,897
Last Blog:
Web slideshow in JavaS...
Rep Power: 78
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Image List

That's what happens to me! What about the property of the ImageList? Did you try changing that, then adding the images?
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
C/C++ FAQ: Read this before you post! v0id C and C++ 7 08-05-2008 01:08 PM
How to make image straight - Photoshop ahsan16 Photoshop Tutorials 56 07-30-2008 04:11 PM
Tutorial: Java Collections Jordan Java Tutorials 0 05-05-2008 07:38 PM
Help with image upload script - need to make an if null statement norbie PHP Forum 7 05-04-2008 10:44 AM
Resize Images And Maintain Original Sharpness AfTriX Photoshop Tutorials 7 04-20-2007 10:55 AM


All times are GMT -5. The time now is 02:15 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads