Click here to Skip to main content
15,891,673 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,
I get an exception whenever I tries to minimize my windows Form for SplitContainer for below code.

C#
private void FrmMain_Resize(object sender, EventArgs e)
{
  this.xSpliterMain.Dock = System.Windows.Forms.DockStyle.Fill;
}


Regards,
Vaibhav
Posted
Comments
Sergey Alexandrovich Kryukov 13-Aug-14 17:26pm    
What exception? In what line? Type name, message, other properties?
—SA
thechauvinism 14-Aug-14 5:31am    
Hello,
To be more specific, I created a SplitContainer in a Form and I am trying to resize it, if the WPF is resize. I am getting exception for "System.StackOverflowException" for line this.xSpliterMain.Dock = System.Windows.Forms.DockStyle.Fill;
Initially the application hanges for few seconds and than I get this exception. It looks like the control "SplitContainer" is trying to perform Dockstyle.Fill when the space is very small.
I observe the same issue if I try to reduce the WPF window size to very small manually.
Hope it help.

1 solution

The code sample is not adequately shown, even of the exception is thrown in a said line, because this exception indicates that you have in "infinite" recursion or mutual recursion:
http://en.wikipedia.org/wiki/Recursion[^],
http://en.wikipedia.org/wiki/Recursion_(computer_science)[^],
http://en.wikipedia.org/wiki/Mutual_exclusion[^].

The problem is spotted by observing the call stack which is overflown. Put a break point on this line; you will see that execution is stopped on this line of code again and again. When it stops, open the Debug Window "Call stack", and you will see where it comes from.

—SA
 
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