you should use try catch blocks to catch exceptions in .NET then handle it if you can, if you cant then perhaps show the user the error but it will be ugly
try
'do something here which may produce an exception
catch ex as Exception
MessageBox.Show(ex.ToString()) 'this will be shown to the user if there was an exception in the try block
end try
you should also catch specific exceptions like FileNotFoundException or IndexOutOfRangeException then finally the general exception.
On error...
Kandisa
you should use try catch blocks to catch exceptions in .NET then handle it if you can, if you cant then perhaps show the user the error but it will be ugly
try
'do something here which may produce an exception
catch ex as Exception
MessageBox.Show(ex.ToString()) 'this will be shown to the user if there was an exception in the try block
end try
you should also catch specific exceptions like FileNotFoundException or IndexOutOfRangeException then finally the general exception.
mGautam
these forums are for .NET Development only. VB6 questions should be posted here:
http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx dg=microsoft.public.vb.general.discussion&cat=en_us_ab067bc0-bda5-4921-a1ec-e76402873945&lang=en&cr=us
Benjamin Coats
... my visual basic 6 somehow shows this code in red. Perhaps it doesn't suppport.
Is there any other ways