Changing Picture Box Image
Changing Picture Box Image
Changing Picture Box Image
Changing Picture Box Image
Changing Picture Box Image
Changing Picture Box Image Changing Picture Box Image Changing Picture Box Image Changing Picture Box Image Changing Picture Box Image Changing Picture Box Image Changing Picture Box Image Changing Picture Box Image
Changing Picture Box Image Changing Picture Box Image
Changing Picture Box Image
Go Back  Xtreme Visual Basic Talk > > > Changing Picture Box Image


Reply
 
Thread Tools Display Modes
  #1  
Old 02-26-2004, 10:31 AM
silentwanderer silentwanderer is offline
Newcomer
 
Join Date: Feb 2004
Location: Columbia, SC
Posts: 2
Default Changing Picture Box Image



I am trying to have the Image in a picture box change when I choose different radio buttons and do not know how to get this.

For instance, If you choose the radio button Dog, I want the picture box to change from the default image to the Dog picture, and so on and so forth.

If anyone could please help me with this, it would vastly help me get this little project finished.

TIA
Reply With Quote
  #2  
Old 02-26-2004, 03:04 PM
Bucky's Avatar
BuckyChanging Picture Box Image Bucky is offline
A+ Certified Nerd

Retired Leader
* Expert *
 
Join Date: Dec 2001
Location: East Coast
Posts: 1,763
Default

Code:
Picture1.Image = Image.FromFile("image path")
__________________
If you're not part of the solution, you're part of the precipitate.
Reply With Quote
  #3  
Old 02-26-2004, 07:47 PM
silentwanderer silentwanderer is offline
Newcomer
 
Join Date: Feb 2004
Location: Columbia, SC
Posts: 2
Default

Quote:
Originally Posted by Bucky
Code:
Picture1.Image = Image.FromFile("image path")



Thanks for the info, I had it just a little off and it wasn't working..

Danke
Reply With Quote
  #4  
Old 01-29-2008, 03:49 PM
Falcata Falcata is offline
Newcomer
 
Join Date: Jan 2008
Posts: 1
Default Also confused

Sorry but can someone refine the advice given into something a bit more introductional. I just started using VB and am a bit confused with the code and stuff. Basically I have 3 files in a folder on my desktop that correspond to 3 radio buttons on the form. When I click one button I want one of the images to be displayed, when I click the 2nd button, another image, etc.
Thanks for any help!
Reply With Quote
  #5  
Old 02-16-2008, 02:39 PM
trippdoctor trippdoctor is offline
Newcomer
 
Join Date: Feb 2008
Posts: 4
Default

Quote:
Originally Posted by Falcata View Post
Sorry but can someone refine the advice given into something a bit more introductional. I just started using VB and am a bit confused with the code and stuff. Basically I have 3 files in a folder on my desktop that correspond to 3 radio buttons on the form. When I click one button I want one of the images to be displayed, when I click the 2nd button, another image, etc.
Thanks for any help!
If this is what you mean its not that hard

Code:
Imports System.IO
Public Class Form1

    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        PictureBox1.Image = Image.FromFile(Application.StartupPath & "\images\1.png")
    End Sub

    Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
        PictureBox1.Image = Image.FromFile(Application.StartupPath & "\images\2.png")
    End Sub

    Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
        PictureBox1.Image = Image.FromFile(Application.StartupPath & "\images\3.png")
    End Sub
End Class
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing an Image to a Picture SteRobson Interface and Graphics 3 07-06-2003 06:03 PM
Changing the Picture in a Image Box from Code ajs2006 Game Programming 2 03-08-2003 06:33 PM
PUblic array With images NeverMore5 Game Programming 3 02-07-2003 01:59 PM
stretch image to fit a Picture Box... Like the stretch property of an Image control usetheforce2 Code Library 1 03-25-2002 04:25 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Changing Picture Box Image
Changing Picture Box Image
Changing Picture Box Image Changing Picture Box Image
Changing Picture Box Image
Changing Picture Box Image
Changing Picture Box Image Changing Picture Box Image Changing Picture Box Image Changing Picture Box Image Changing Picture Box Image Changing Picture Box Image Changing Picture Box Image
Changing Picture Box Image
Changing Picture Box Image
 
Changing Picture Box Image
Changing Picture Box Image
 
-->