ironfistchamp
Active member
- Joined
- Dec 9, 2005
- Messages
- 29
- Programming Experience
- Beginner
I have some code to stop my program throwing errors when you press cancel on the open and save dialog boxes.
Looks like this
openFD.InitialDirectory = "C:\"
openFD.Filter = "Jpeg Files|*.jpg"
openFD.ShowDialog()
Dim DidWork As Integer = openFD.ShowDialog()
If DidWork = Windows.Forms.DialogResult.OK Then
pbox.Visible = True
rtbMain.Visible = False
pbox.ImageLocation = openFD.FileName
End If
When you press cancel the dialog box opens again. If you press cancel for the second time it goes. if this code is left out and just tell it how to open it throws up errors. can someone help stop it opening a second time?
Thanks
Ironfistchamp
Looks like this
openFD.InitialDirectory = "C:\"
openFD.Filter = "Jpeg Files|*.jpg"
openFD.ShowDialog()
Dim DidWork As Integer = openFD.ShowDialog()
If DidWork = Windows.Forms.DialogResult.OK Then
pbox.Visible = True
rtbMain.Visible = False
pbox.ImageLocation = openFD.FileName
End If
When you press cancel the dialog box opens again. If you press cancel for the second time it goes. if this code is left out and just tell it how to open it throws up errors. can someone help stop it opening a second time?
Thanks
Ironfistchamp