bug on calendar control
"Pedro Cardoso" <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.wxnet |
|---|---|
| Message-ID | <[email protected]> |
the following code raises an exception when we quit the application.
Exception
"An unhandled exception of type 'System.NullReferenceException' occurred in
wx.net.dll
Additional information: Object reference not set to an instance of an
object."
Code
using System;
using System.Drawing;
using wx;
namespace wx.Samples
{
public class MyFrame : wx.Frame
{
public const int ID_DATETIMEPICKER1 = 1;
CalendarCtrl dateTimePicker1;
public MyFrame(string title, Point pos, Size size) : base(title,
pos, size)
{
dateTimePicker1 = new CalendarCtrl(this,
ID_DATETIMEPICKER1, DateTime.Now, new Point(208, 72), new Size(192, 20));
}
}
// Define a new application type, each program should derive a class
from App
public class MyApp : wx.App
{
public override bool OnInit()
{
MyFrame frame = new MyFrame("Form1", new Point(50,50), new
Size(536,415));
frame.Show(true);
return true;
}
[STAThread]
static void Main()
{
MyApp app = new MyApp();
app.Run();
}
}
}