Inserting Pictures

Tyecom

Well-known member
Joined
Aug 8, 2007
Messages
78
Programming Experience
Beginner
Hi,
I'll try to explain this very simply. I have a form with a PictureBox1, Texbox1, TextBox2, and Button1. What I want to be able to do is: Enter a name in TextBox1, and based on that "name", place an Image in PictureBox1 and insert the number of the Image in TextBox2.

Example: In TextBox1 I enter "Gia", and press Button1. The results will be a Image being inserted into Picturebox1 and the IDnumber of that image being inserted into TextBox2. All my images are stored in C:Images. My movie titles are stored in a sql database or a datagrid in the application. I'm very new at this and hopefully I explained this clearly. Thank you in advance.

Here is my code. As you can see, it's hard coded. I need this to be dynamic, because the TextBox1 is a search box.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

If TextBox1.Text = "Gia" Then
PictureBox1.Image = Image.FromFile("C:\Images\0001.jpg")
TextBox2.Text = "0001"
TextBox3.Visible = True
TextBox3.Text = "Angelina Jolie is mesmerizing in her breakout role as supermodel Gia Carangi, " & _
"a cover girl who lived fast and died at age 26 from the ravages of AIDS."

Else
MsgBox("Movie Not Found! Please Try Again.", , "Movie Status Window")

End If
 
Last edited:
Back
Top