|
-
Aug 29th, 2006, 06:15 AM
#1
Thread Starter
Addicted Member
[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.

Giving an exact answer
Saves a lot of time!!!
-
Aug 29th, 2006, 09:22 AM
#2
Fanatic Member
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()
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Aug 29th, 2006, 09:55 AM
#3
Thread Starter
Addicted Member
-
Aug 29th, 2006, 10:12 AM
#4
Fanatic Member
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
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Aug 29th, 2006, 10:27 AM
#5
Thread Starter
Addicted Member
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??

Giving an exact answer
Saves a lot of time!!!
-
Aug 29th, 2006, 10:29 AM
#6
Fanatic Member
Re: loading a picture into a picturebox...
there is no d: drive on a PDA Device
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Aug 29th, 2006, 10:36 AM
#7
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|