Hi, I am outputting an exe file and have an option to add an icon. The keyword is "option" but when I don't add an icon, it gives me an error saying "Empty Path Name Is Not Legal"
The following code is what I am using. Mind you the app still spits out the file just fine even with the error. I would just like to somehow suppress/get rid of the error.
Any and all help is much appreciated! Thanks in advance
The following code is what I am using. Mind you the app still spits out the file just fine even with the error. I would just like to somehow suppress/get rid of the error.
Any and all help is much appreciated! Thanks in advance
Code:
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim ofd As New OpenFileDialog
ofd.Title = "Select an icon"
ofd.Filter = "Icon (*.ico)|*.ico"
If ofd.ShowDialog <> vbOK Then
Exit Sub
End If
TextBox4.Text = ofd.FileName
PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
PictureBox1.ImageLocation = ofd.FileName
End Sub