[2005] loading a picture into a picture box..
hi,
I have 2 pictures in my app directory , 2 radio buttons and a picture box
I want that with choose the first button it will load the picture into the picture box , and if choose the second button it will load the second picture
,it's suppose to be very simple but , I didn't manage to do it ,
so please help.
:confused: :confused: :confused:
Re: [2005] loading a picture into a picture box..
VB Code:
if radiobutton1.Checked = True then
picturebox1.Load(application.StarupPath & "\image1.jpg")
elseif radiobutton2.checked = true then
picturebox2.load(application.StarupPath & "\image2.jpg")
end if
Re: [2005] loading a picture into a picture box..
I put this code in the radio button and it says-
"load is not a member of windows forms application , what does it mean?
and another thing that doesn't fit is-
I want to use only one picturebox ,and with choose of one radio button it will load the picture in the same picturebox for both radio buttons...
Re: [2005] loading a picture into a picture box..
I don't have the ide in front of me, so use visual studios intelisense. It's either load, or loadfile. Instead of just copying and pasting the code, look at it and see what it does. This should be easy enough for you to convert into what you want.
Quote:
Originally Posted by noam
Giving an exact answer Saves a lot of time!!!"
But you don't learn anything because you copy and paste the code and don't look at what it does.
Re: [2005] loading a picture into a picture box..
try this
VB Code:
If Me.radiobutton1.Checked = True Then
Me.PictureBox1.Image = New Bitmap(My.Application.Info.DirectoryPath & "\image1.jpg")
ElseIf Me.radiobutton2.checked = True Then
Me.PictureBox1.Image = New Bitmap(My.Application.Info.DirectoryPath & "\image2.jpg")
End If
Re: [2005] loading a picture into a picture box..
Thank you for your reply ,
I'll check this code when I arrive home, :) :) :)
and by the way - mpdeglau ,
I do learn from codes! I wrote a very nice applications using VB6 ,and also I learned it from codes.
of course it is nice to add an explanation for what you're doing but after I get the code , and combine it with my app. I write remarks , explaning how it works.
Some day I'll be very helpfull here.
:wave: