Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Change image in UserForm

I want to create a userform with a listbox that has 4 columns, one
column is Customer#. Each item in the list will have a related picture
of the same name (i.e. Customer# 01234 = X:\Pictures\01234.jpg) stored
in a folder on my computer.

Is it possible to have the Image control on the userform updated 'when
the item in the list is selected' rather than having to click on a
command button, so that each time you would select an item in the list,
the image on the userform would change?

Thanks,
Joe

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Change image in UserForm

Private Sub Listbox1_Click()
if listbox1.ListIndex < -1 then
Image1.Picuture = loadPicture( _
"X:\Pictures\" & Listbo1.Value & ".jpg")
end if
End Sub

Depends on what the value of Listbox1 is. Here, I assume it is the name of
the picture (Customer#). Set the customer# column as the BoundColumn for
the listbox.

--
Regards,
Tom Ogilvy


"Joseph" wrote in message
ups.com...
I want to create a userform with a listbox that has 4 columns, one
column is Customer#. Each item in the list will have a related picture
of the same name (i.e. Customer# 01234 = X:\Pictures\01234.jpg) stored
in a folder on my computer.

Is it possible to have the Image control on the userform updated 'when
the item in the list is selected' rather than having to click on a
command button, so that each time you would select an item in the list,
the image on the userform would change?

Thanks,
Joe



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
moving an image in a userform Gixxer_J_97[_2_] Excel Programming 5 May 19th 05 12:08 AM
Check image availability on userform gki Excel Programming 3 July 22nd 04 05:53 PM
UserForm as a Jpeg Image John[_78_] Excel Programming 7 February 19th 04 11:46 AM
Bmp vs Gif in Userform image controls Sandy-V[_2_] Excel Programming 0 January 14th 04 01:46 PM
Userform Image help Pete[_13_] Excel Programming 1 November 10th 03 10:26 PM


All times are GMT +1. The time now is 06:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"