Hi all,
I am using Visual Studio to create a form that will allow a user to enter a product code into a field, click enter and the form will display an image that refers to the product.
The product image is always in the same location, "C:\pics\" and is always named after the product code, but with the suffix ".jpg".
I am really struggling to ge this to work as Im not a programmer and don't know where to start, and have searched the net...
Code I have at the mo is;
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Dir("C:\pics\" & TextBox1 & ".jpg") <> "" Then
PictureBox1.Image = ("C:\pics\" & TextBox1 & ".jpg")
Else
PictureBox1.Image = ("C:\pics\nopic.jpg")
End If
End Sub
But its not working at all... can anyone help!! Please!!
Thanks,
David
I am using Visual Studio to create a form that will allow a user to enter a product code into a field, click enter and the form will display an image that refers to the product.
The product image is always in the same location, "C:\pics\" and is always named after the product code, but with the suffix ".jpg".
I am really struggling to ge this to work as Im not a programmer and don't know where to start, and have searched the net...
Code I have at the mo is;
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Dir("C:\pics\" & TextBox1 & ".jpg") <> "" Then
PictureBox1.Image = ("C:\pics\" & TextBox1 & ".jpg")
Else
PictureBox1.Image = ("C:\pics\nopic.jpg")
End If
End Sub
But its not working at all... can anyone help!! Please!!
Thanks,
David