[RESOLVED] loading a picture into a picturebox...
Hi ,
I have 2 radiobuttons and 1 picturebox
when choose radiobutton 1 I want to load picture1 into the picturebox
and when choose radiobutton 2 I want to load picture2 into the same picturebox .
I have tried this:
Code:
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
If RadioButton2.Checked = True Then
PictureBox1.Load(Application.StarupPath & "\T.jpg")
End If
End Sub
but as you probably understand it doesn't work ,Why?!
please need your quick respond.
:wave:
Re: loading a picture into a picturebox...
whats happening, are you getting any error messages. if so add a try catch.
try adding picturebox1.refresh() or update()
Re: loading a picture into a picturebox...
NO, Sorry I didn't understand.
Can you write this line of code , I'm sort of a new in vb Net.
it tells me that -" Application.StarupPath " is not a member of ...
It suppose to be easy - How should I load a picture with button click into a picturebox , ( if the picture should be in a spesific path like - D:\PIC\ , so it can be , but I don't know how to do it , please all the exepert here-could you answer?!
:confused: :confused: :confused:
Re: loading a picture into a picturebox...
heres how to do it in visual studio 2003
Dim l_bmp As Bitmap
Try
l_bmp = New Bitmap("\My Document\ba.jpg")
PictureBox1.Image = l_bmp
Catch ex As Exception
MsgBox(ex.Message)
End Try
Re: loading a picture into a picturebox...
It gives an error:
" An error message cannot be displayed because an optional resource assembly contaning it cannot be found"
this is what I've done:
Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim l_bmp As Bitmap
Try
l_bmp = New Bitmap("D:\PIC\L10.jpg")
PictureBox1.Image = l_bmp
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Whats wrong??
Re: loading a picture into a picturebox...
there is no d: drive on a PDA Device
Re: loading a picture into a picturebox...
You are right !!! it works just fine!
:wave: :wave: :wave: :wave: :wave:
Maybe you could solve my second question for cab make , it is in a new thread, as it suppose to be. :wave: