OutOfMemoryException on a new MDI child

  • Thread starter Thread starter Mr.Tickle
  • Start date Start date
M

Mr.Tickle

private void toolBar1_ButtonClick(object sender,
System.Windows.Forms.ToolBarButtonClickEventArgs e)

{

int buttonPushed = this.toolBar1.Buttons.IndexOf(e.Button);

switch (buttonPushed)

{

case 0:

{

Form f1 = new Form();

f1.Text = "child form 1";

f1.MdiParent = this;

f1.Load += new System.EventHandler(this.onMdiLoad);

f1.Show();

break;

}





Odd. on the Show() call i get OutOfMemoryException.
 
If I remove the .Load += event handler line its ok but with it i get out of
memry exception. hmm why , any1?
 
* "Mr.Tickle said:
If I remove the .Load += event handler line its ok but with it i get out of
memry exception. hmm why , any1?

Is there any code placed in the 'Load' event handler?
 
Back
Top