Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

isiahil

picturebox won't loadpicture

This topic is 5280 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

When i execute the code it gives my an error saying that there is a type mismatch. I use a dialog box to let the user choose a picture file. But then the code gets to the case statement and then says there is a type mismatch and the Case Right(Filename, 3)... line is highlighted.
Private Sub open_Click()
dialog.ShowOpen
Filename = dialog.Filename
Select Case Filename

Case Right(Filename, 3) = "bmp" Or "jpg" Or "tga"
    picscreen.Picture = loadPicture(dialog.Filename)
    
End Select

    
End Sub

Share this post


Link to post
Share on other sites
Advertisement
Try:

Case Right(Filename, 3) = "bmp" Or Right(Filename, 3) = "jpg" Or Right(Filename, 3) = "tga"

Share this post


Link to post
Share on other sites

  • 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!