S
sb
In the simplified code below, shouldn't the thrown exception cause the app
to terminate since it is unhandled? It doesn't seem to do anything in Debug
or Release mode. I do get a first-chance exception message in the debugger
but that's it. Something seems to be intercepting the exception and
handling it...but I don't know what.
Any info would be appreciated
-sb
// Entire program
using System;
using System.Windows.Forms;
static class Program
{
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
public class Form1 : Form
{
public Form1()
{
this.AllowDrop = true;
this.DragDrop += new
System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
this.DragOver += new
System.Windows.Forms.DragEventHandler(this.Form1_DragOver);
}
private void Form1_DragOver(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Copy; // We'll accept any kind of drop
}
private void Form1_DragDrop(object sender, DragEventArgs e)
{
throw new InvalidOperationException("DragDrop exception."); //
nothing happens here
}
}
to terminate since it is unhandled? It doesn't seem to do anything in Debug
or Release mode. I do get a first-chance exception message in the debugger
but that's it. Something seems to be intercepting the exception and
handling it...but I don't know what.
Any info would be appreciated
-sb
// Entire program
using System;
using System.Windows.Forms;
static class Program
{
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
public class Form1 : Form
{
public Form1()
{
this.AllowDrop = true;
this.DragDrop += new
System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
this.DragOver += new
System.Windows.Forms.DragEventHandler(this.Form1_DragOver);
}
private void Form1_DragOver(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Copy; // We'll accept any kind of drop
}
private void Form1_DragDrop(object sender, DragEventArgs e)
{
throw new InvalidOperationException("DragDrop exception."); //
nothing happens here
}
}