|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Raiseevent inside catch blockCan you raise an event within a catch block in VB.NET ?( 1.1 Framework)
I am seeing some unexpected behavior in other parts of the WinForm app. I just wondered if it is even "legal" to do this. TIA RJ wrote:
> Can you raise an event within a catch block in VB.NET ?( 1.1 It certainly ought to be legal (caveat - I haven't personally verified that > Framework) > I am seeing some unexpected behavior in other parts of the WinForm > app. I just wondered if it is even "legal" to do this. TIA for .NET 1.1, but it would be a serious flaw for this to be illegal/undefined). Inside the catch block the original exception is handled (no longer exists - unless you re-throw it). Throwing a new exception from within the catch should still run any associated finally block and begin a new handler search starting in the scope that contains the try/catch. -cd I have raised events within a catch block in a service and within an
asp.net app without problems. As far as I know, its perfectly legal. Unfortunately I have no experience doing this within a windows forms app. What kind of unexpected behavior are you getting? |
|||||||||||||||||||||||