Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

re. why wont the images change

Status
Not open for further replies.

DGEN

Programmer
Oct 29, 2004
17
GB
Hi All

I am not used to working in vb.net as of yet so this will seem like a real newbie question.

i am trying to link an array to six images that are in my program i assumed that the below code would would work as i cannot see another way in the list of objects that appers on pressing the period.

but to my bitter dissapointment it did not work it just left my image boxes transparent. can any body help me out on this issue

cheers

Card_1.Image.FromFile("..\Card Decks\Dark Pack\" & number_choose(0) & ".jpg")
Card_2.Image.FromFile("..\Card Decks\Dark Pack\" & number_choose(2) & ".jpg")
Card_3.Image.FromFile("..\Card Decks\Dark Pack\" & number_choose(7) & ".jpg")
Card_4.Image.FromFile("..\Card Decks\Dark Pack\" & number_choose(4) & ".jpg")
Card_5.Image.FromFile("..\Card Decks\Dark Pack\" & number_choose(1) & ".jpg")
Card_6.Image.FromFile("..\Card Decks\Dark Pack\" & number_choose(8) & ".jpg")
 
not sure off the top of my head, but you may need a .refresh after the image changes.

Also, you should check out the image list control. It lets you put all of your images into a collection at design time.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Hi Thank you for your reply but i had got to the botom of it

I thought that the below code would work

Card_1.Image.FromFile("..\Card Decks\Dark Pack\" & number_choose(6) & ".jpg")


But it was simply:

Card_1.Image = Image.FromFile("..\Card Decks\Dark Pack\" & number_choose(6) & ".jpg")

that was the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top