2012-02-20 07:30:47 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
2012-04-25 07:10:11 -03:00
|
|
|
|
using System.Windows.Forms;
|
2012-02-20 07:30:47 -04:00
|
|
|
|
|
|
|
|
|
namespace System.Windows.Forms
|
|
|
|
|
{
|
2012-04-24 10:49:27 -03:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// This is a mono fix, windows handles this error, mono crashs
|
|
|
|
|
/// </summary>
|
2012-02-20 07:30:47 -04:00
|
|
|
|
public class MyUserControl : System.Windows.Forms.UserControl
|
|
|
|
|
{
|
2012-07-22 04:51:05 -03:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// implement an on closing event to tidy up enviroment.
|
|
|
|
|
/// Using preedefined refrence as can easerly change betwen form and user control this way.
|
|
|
|
|
/// </summary>
|
2012-04-25 07:10:11 -03:00
|
|
|
|
public event FormClosingEventHandler FormClosing;
|
|
|
|
|
|
|
|
|
|
public void Close(object sender, FormClosingEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (FormClosing != null)
|
|
|
|
|
FormClosing(sender,e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Close()
|
|
|
|
|
{
|
|
|
|
|
Close(this, new FormClosingEventArgs(CloseReason.UserClosing, false));
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-20 07:30:47 -04:00
|
|
|
|
protected override void WndProc(ref Message m)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
base.WndProc(ref m);
|
|
|
|
|
}
|
|
|
|
|
catch { }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|