Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- App to test MWF exception handling

svn path=/trunk/winforms/; revision=54148
  • Loading branch information...
commit 6a281fcb1268b7e1b8a248eb048f31530fa0be62 1 parent 3875187
Peter Dennis Bartok authored
Showing with 53 additions and 0 deletions.
  1. +10 −0 exception/Makefile
  2. +43 −0 exception/exception.cs
View
10 exception/Makefile
@@ -0,0 +1,10 @@
+all: exception.exe
+
+exception.exe: exception.cs
+ mcs exception.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
+
+dotnet: exception.cs
+ csc exception.cs /r:System.Windows.Forms.dll /r:System.Drawing.dll
+
+clean:
+ rm exception.exe -r -f
View
43 exception/exception.cs
@@ -0,0 +1,43 @@
+//
+
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+using System.Threading;
+
+namespace testwin
+{
+ public class MainForm : Form
+ {
+ private Button button;
+ private Label label;
+ public MainForm()
+ {
+ button = new Button();
+ SuspendLayout();
+ button.Location = new System.Drawing.Point(40, 32);
+ button.Text = "Push me to cause an exception";
+ button.Click += new System.EventHandler(OnClick);
+ button.Size = new Size(100, 28);
+ AutoScaleBaseSize = new Size(5, 13);
+ ClientSize = new System.Drawing.Size(292, 266);
+ Controls.Add(button);
+ Text = "Exception test";
+ label = new Label();
+ ResumeLayout(false);
+ }
+
+ [STAThread]
+ public static void Main(string[] args)
+ {
+
+ Application.Run(new MainForm());
+ }
+
+ void OnClick(object sender, System.EventArgs e)
+ {
+ label.BorderStyle = (BorderStyle)1234;
+ }
+ }
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.