[Windows Mobile Software Development] v8dave:
Out of memory error when creating form

Hi all,

I get an out of memory exception when it executes the this.resumelayout(false); function.

I am new to C# but familiar with C++ so just getting to grips with it. I have searched the forum and found nothing similar (!)

Here is the code I use on the form. Maybe someone can spot the error? :)

private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();

this.mnuExpense = new System.Windows.Forms.MainMenu();
this.mnuClose = new System.Windows.Forms.MenuItem();
this.mnuCancel = new System.Windows.Forms.MenuItem();

this.sip = new Microsoft.WindowsCE.Forms.InputPanel(this.components);
this.senseHeaderCtrl = new StedySoft.SenseSDK.SenseHeaderControl();
this.senseListCtrl = new StedySoft.SenseSDK.SenseListControl();
this.SuspendLayout();
//
// senseHeaderCtrl
//
this.senseHeaderCtrl.Dock = System.Windows.Forms.DockStyle.Top;
this.senseHeaderCtrl.Location = new System.Drawing.Point(0, 0);
this.senseHeaderCtrl.Name = "senseHeaderCtrl";
this.senseHeaderCtrl.Size = new System.Drawing.Size(240, 25);
this.senseHeaderCtrl.TabIndex = 1;
this.senseHeaderCtrl.Text = "Expense Input";
//
// senseListCtrl
//
this.senseListCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
this.senseListCtrl.FocusedItem = null;
this.senseListCtrl.IsSecondaryScrollType = false;
this.senseListCtrl.Location = new System.Drawing.Point(0, 25);
this.senseListCtrl.MinimumMovement = 15;
this.senseListCtrl.Name = "senseListCtrl";
this.senseListCtrl.ShowScrollIndicator = true;
this.senseListCtrl.Size = new System.Drawing.Size(this.ClientRectangle.Width, this.ClientRectangle.Bottom);
this.senseListCtrl.Springback = 0.35F;
this.senseListCtrl.TabIndex = 3;
this.senseListCtrl.ThreadSleep = 100;
this.senseListCtrl.TopIndex = 0;
this.senseListCtrl.Velocity = 0.9F;
//
// mnuMain
//
this.mnuExpense.MenuItems.Add(this.mnuClose);
this.mnuExpense.MenuItems.Add(this.mnuCancel);
//
// mnuClose
//
this.mnuClose.Text = "Done";
this.mnuClose.Click += new System.EventHandler(this.mnuClose_Click);
//
// mnuCancel
//
this.mnuCancel.Text = "Cancel";
this.mnuCancel.Click += new System.EventHandler(this.mnuClose_Click);
//
// NewExpenseForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(this.ClientRectangle.Width, this.ClientRectangle.Height);
this.BackColor = StedySoft.SenseSDK.DrawingCE.SenseColors.List_Background;
this.ControlBox = false;
this.Controls.Add(this.senseListCtrl);
this.Controls.Add(this.senseHeaderCtrl);
this.Menu = this.mnuExpense;
this.Name = "NewExpenseForm";
this.Text = "Expense Input";
this.Load += new System.EventHandler(this.NewExpenseForm_Load);
this.Closed += new System.EventHandler(this.NewExpenseForm_Closed);
this.Closing += new System.ComponentModel.CancelEventHandler(this.NewExpenseForm_Closing);
this.ResumeLayout(false);
}

#endregion
private System.Windows.Forms.MenuItem mnuClose;
private System.Windows.Forms.MenuItem mnuCancel;
private Microsoft.WindowsCE.Forms.InputPanel sip;
private StedySoft.SenseSDK.SenseListControl senseListCtrl;
private StedySoft.SenseSDK.SenseHeaderControl senseHeaderCtrl;