FunkMaster
02-24-2004, 03:56 AM
Hey guys, I'm a newbie at this and I'm having problems:
I'm trying to display an image on a form for a specific product. When you select a different product from the ComboBox I want the image on the form to change to the image for the selected product.
Please tell me if there is an easier way and/or help me complete this solution:
I have 50 PictureBoxes loaded with the image for each of my 50 products and with Visible set to False.
I have another Main PictureBox, which is Visible, and the Image in this PicBox should change by using the appropriate image from the appropriate product PicBox.
The user selects the ComboBox Item 'Product036' and I want the image in the Visible Image Box to change to show the image for Product36.
The following doesn't work but is what I want to achieve:
'get the name of the selected product from the ComboBox
Dim strSelectedProduct As String = cbxProductList.SelectedItem
'chnage the image in the Main PicBox to change to show the image of the PicBox for the selected item
pbxMainVisiblePicBox.Image = pbxInvisible'strSelectedProduct'PicBox.Image
- I don't know how to dynamically choose which picbox to load from.
Thanks for any help you can give me.
I'm trying to display an image on a form for a specific product. When you select a different product from the ComboBox I want the image on the form to change to the image for the selected product.
Please tell me if there is an easier way and/or help me complete this solution:
I have 50 PictureBoxes loaded with the image for each of my 50 products and with Visible set to False.
I have another Main PictureBox, which is Visible, and the Image in this PicBox should change by using the appropriate image from the appropriate product PicBox.
The user selects the ComboBox Item 'Product036' and I want the image in the Visible Image Box to change to show the image for Product36.
The following doesn't work but is what I want to achieve:
'get the name of the selected product from the ComboBox
Dim strSelectedProduct As String = cbxProductList.SelectedItem
'chnage the image in the Main PicBox to change to show the image of the PicBox for the selected item
pbxMainVisiblePicBox.Image = pbxInvisible'strSelectedProduct'PicBox.Image
- I don't know how to dynamically choose which picbox to load from.
Thanks for any help you can give me.