Hello, I have another problem with my project. I have a form, that saves image from computer to databese. Saving, deleting all works except this. When you click button to open windows search (to find picture from computer), if you click "Cancel" it shows a mistake. Here is my code:
So if I click "Cancel", application stop working and line this row of code: ChosenPicturePictureBox.Image = Image.FromFile(TextBox1.Text) so that is here mistake. Open button works normal.Code:Private Sub ButtonOPEN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonOPEN.Click OpenFileDialog1.ShowDialog() TextBox1.Text = OpenFileDialog1.FileName ChosenPicturePictureBox.Image = Image.FromFile(TextBox1.Text) End Sub
Also, how do I prevent to chosing other files exceot JPEG files.
Realy thanks for all idea.




Reply With Quote