Anything inside of quotes is treated literally. So, given the following code:Code:pboxHangman.ImageLocation = "Images \ Hangman- & numWrongGuesses & .png"
Would pop up messages in the following order:Code:Dim strMyMessage As String = "Hello!" Dim intMyNumber As Integer = 1 MessageBox.Show("strMyMessage") MessageBox.Show(strMyMessage) MessageBox.Show("intMyNumber.ToString") MessageBox.Show(intMyNumber.ToString)
From this, you can see that including a variable name inside of quotes does not result in the value stored in that variable to be used.Code:strMyMessage Hello! intMyNumber.ToString 1
To demonstrate this, take the path you are trying to use to load an image from, and pop it into a MessageBox statement:
You should see that what is displayed is probably not the intended path to one of your image files.Code:MessageBox.Show("Images \ Hangman- & numWrongGuesses & .png")




Reply With Quote
