OutOfMemoryException on a new MDI child

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.
 
M

Mr.Tickle

If I remove the .Load += event handler line its ok but with it i get out of
memry exception. hmm why , any1?
 
H

Herfried K. Wagner [MVP]

* "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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top