Click here to Skip to main content
14,356,475 members
Rate this:
Please Sign up or sign in to vote.
See more:
this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
  this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image")));
  this.toolStripButton3.Name = "toolStripButton3";
  this.toolStripButton3.RightToLeftAutoMirrorImage = true;
  this.toolStripButton3.Size = new System.Drawing.Size(23, 22);
  this.toolStripButton3.Text = "Move first";


What I have tried:

This message suddenly showed me and I do not know why
I use Frame work 4
Posted
Updated 26-Apr-17 0:07am
Comments
CHill60 26-Apr-17 4:42am
   
Which of those lines produced the exception. Where are those lines placed? What is the code around those lines? Have you tried using the debugger?
Samoowaseem 26-Apr-17 5:09am
   
Thanks my friend "CHILL60" The issue has been resolved

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

We can't answer this for you - you need to work it out for yourself. Why? Because we can't run your code, and this is a run time problem which can't be "worked out" just from looking at trivial code fragments in isolation.

Let me explain why it's happened: something in your code is probably causing recursion. I.e. some action in your code causes the same action to happen again. For example, imagine you have a form, and you handle it's "resize" event. If in the resize event handler you change the size of the form, the resize event will happen again. And again. And again ... until something catastrophic happens and the system collapses. A simpler way to do this is to call a method from inside the method either directly:
void xx()
   {
   xx();
   }
Or indirectly:
void xx()
   {
   yy();
   }
void yy()
   {
   xx();
   }
At some point you run out of space on the stack to store the return addresses and you get a "stack overflow" exception.
That's what's happened here - something has run out of stack space, and direct or indirect recursion is the most likely cause.

So use the debugger, look at the exception detail, look at the stack trace. see if you can see where it all started, and put a breakpoint on that line and run your code again. Now look closely at all the variables, and step your code line-by-line. Look for something happening that you didn't expect.

Sorry, but we can't do any of that for you!
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100