Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
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 25-Apr-17 23:07pm
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

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:
C#
void xx()
   {
   xx();
   }
Or indirectly:
C#
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!
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900