Steve,
As Carlos suggests, you cannot do that.
The "best" you could do is to put a Try/Catch around each of the commands
you want retry and have the Catch block retry the Try Block. I find using
Goto in the Catch block the "easiest" way to "Retry", others have put the
entire Try/Catch in a loop...
BTW: I've heard all the arguments about how Goto is evil & should be
avoided, in this case the "Goto Retry" is more like a "Retry" statement. Yes
"goto retry" could be used for evil, however it can also be used for good...
Something like:
Try Retry:
'...something
Catch ex as FileNotFoundException
If MessageBox.Show("File does not exit!", _
Application.ProductName, _
MessageBoxButtons.RetryCancel, _
MessageBoxIcon.Question, _
MessageBoxDefaultButton.Button2) _
= DialogResult.Retry Then
GoTo retry
End If
Caution: With either the Goto Retry or a loop, be certain to allow your
users an Out, so you don't get into an endless loop.
Hope this helps
Jay
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
| Hi All
|
| In VB6 I used to catch exceptions in a goto errtrap call then resume if I
| could handle the problem and continue within the routine or function
|
| I am not sure how to do this in VB 2005 from within a catch statement
|
| Any ideas appreciated
|
|
| --
| Regards
| Steve