|
-
Nov 25th, 2012, 01:46 AM
#1
Thread Starter
Hyperactive Member
Random Images with website links
On my form I have the image and in my resource file I have 10 images.
Can someone assist me with my code on how to add the right website link to the right image please, thank you.
Code:
Private Sub PictureBox1_Click(sender As System.Object, e As System.EventArgs) Handles PictureBox1.Click
PictureBox1.Image = My.Resources.Resources.Banner_0
Dim BANNERSTRING As String
Randomize()
BANNERSTRING = "My.Resources.Resources.Banner_" & Int(Rnd() * 1000000) Mod 10
'MsgBox(BANNERSTRING)
'Dim ImgLoad As Bitmap = GetObject(BANNERSTRING)
PictureBox1.Image = My.Resources.ResourceManager.GetObject("My.Resources.Resources.Banner_1")
End Sub
-
Nov 25th, 2012, 09:27 AM
#2
Re: Random Images with website links
Images have a Comment property in which you could store the web address. Alternatively you could use the Name property as an alias and use a dictionary to tie up the alias and the web address or you could simply store the web addresses as Strings in the resources file in the same order as the images and use parallel indexing.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Nov 26th, 2012, 03:20 AM
#3
Thread Starter
Hyperactive Member
Re: Random Images with website links
Im sorry you completely befuddled the heck out of me repeating yourself there.
-
Nov 26th, 2012, 01:01 PM
#4
Re: Random Images with website links
Just where do I repeat myself?
Option 1: store the relevant web address in each image's .Comment property
Option 2: use a dictionary to translate the image Name to the web address
Option 3: use the resource file to store all the web addresses as string resources
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|