Exceptions are not raised

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi to everyone. I am studying VB.net and I am wondering why this trivial code doesn't raise any exception:

Option Strict On

Imports System
Imports Microsoft.VisualBasic


Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim num1, num2 As Short
Dim num3 As Double
num1 = 5
num2 = 0
Try
num3 = num1 / num2
Catch ex As DivideByZeroException
MsgBox("Divisione per 0!")
End Try
End Sub

End Class

No msgbox is executed!!!
I'm using VB 2005 Express Edition.
Should I set anything in the framework or project properties?
Thanks in advance to everyone.

Giuseppe from Italy.
.



Relevant Pages

  • Re: Send Email Using VB 2008 Express
    ... Imports System.Web.Mail.SmtpMail.Send ... Public Class Form1 ... Private Sub btnSend_Click(ByVal sender As System.Object, ... The System.Web namespace has been deprecated, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How do I dump Image data type in SQL Server
    ... Invalid parameter used ... Imports System.Data ... Public Class Form1 ... Private Sub Form1_Load(ByVal sender As Object, ...
    (microsoft.public.dotnet.languages.vb)
  • SQLClientPermission Error
    ... Request for the permission of type ... Imports System.Configuration ... 'Public Class Form1 ... Private Sub Button1_Click(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.general)
  • VB.NET Shutdown from text file
    ... Option Explicit On ... Imports System.IO ... Public Class Form1 ... Private Sub Form1_Load(ByVal sender As System.Object, ...
    (microsoft.public.vb.general.discussion)
  • Re: VB.NET Shutdown from text file
    ... Option Explicit On ... Imports System.IO ... Public Class Form1 ... Private Sub Form1_Load(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.languages.vb)