Jump to content
  • Advertisement
Sign in to follow this  
its_matt

Visual Basic .NET language problem

This topic is 4782 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Only post here if you know VB .NET's language.
I need help in VB. I am making a tick tac toe game. Pretty simple right, but I have never tryed it in VB.
I got to a point in scripting where I was stuck. Here is where I need help.

If (Label3.Text = "Player 1:" And PictureBox6.Image Is "(none)") Then Label3.Text = "Player 2:" PictureBox6.Image = System.Drawing.Image.FromFile("x.gif") Else End If If (Label3.Text = "Player 2:" And PictureBox6.Image Is "(none)") Then Label3.Text = "Player 1:" PictureBox6.Image = System.Drawing.Image.FromFile("o.gif") Else End If

Right where it says 'PictureBox6.Image Is "(none)"' I am trying to make it so if there is no picture loaded in that space clicked then do... but if a picture is loaded do nothing.
Please respond.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by its_matt
Only post here if you know VB .NET's language.

I need help in VB. I am making a tick tac toe game. Pretty simple right, but I have never tryed it in VB.

I got to a point in scripting where I was stuck. Here is where I need help.


If (Label3.Text = "Player 1:" And PictureBox6.Image Is "(none)") Then
Label3.Text = "Player 2:"
PictureBox6.Image = System.Drawing.Image.FromFile("x.gif")
Else
End If
If (Label3.Text = "Player 2:" And PictureBox6.Image Is "(none)") Then
Label3.Text = "Player 1:"
PictureBox6.Image = System.Drawing.Image.FromFile("o.gif")
Else
End If



Right where it says 'PictureBox6.Image Is "(none)"' I am trying to make it so if there is no picture loaded in that space clicked then do... but if a picture is loaded do nothing.

Please respond.


the Image property of the PictureBox class is not a string. If you want to test if there is an image loaded to it, test for Nothing.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!