fweeee

Hi,

I'm trying to acheive two things, but as they are both with images and buttons, I have combined them into one posting.

Firstly, I want to make the image on a button dynamic. Just a snippet of code to show how to change it will be enough (googling found me lots of sites showing how to manually change it in the properties).

Secondly, I want to have a central repository of images throughout my whole application, which each form will use. If I change the image in the central repository, I'd like the change to be reflected throughout the project (all forms). Is this possible

Thanks.


Re: Visual Basic General Images on buttons - Changing them dynamically and ensuring constancy

Dave Patricio

hi fweeee,

try using an imagelist. you can programmatically access the images there.

dave.





Re: Visual Basic General Images on buttons - Changing them dynamically and ensuring constancy

fweeee

Thanks, but can you provide me with a little bit more information then that I have an image list (on the main form of my project), but I cant work out how to set the image properties of a button at runtime.




Re: Visual Basic General Images on buttons - Changing them dynamically and ensuring constancy

fweeee

Never mind - I worked it out.

txtBox.Image = ImageList1.Images.Item(index)