Program stop at a statement (backgound.Visible=true). Why?
This is my program:
{
statement1;
...
background.Visbile = true;
...
statementx;
}
When I run this program, it stops at background.Visible=true; statement. Anybody know why?
More information: background is TableLayoutPanel object. 'stop' mean program freeze and don't run to next statement.I can't debug this program, only wri开发者_JS百科te log. Application just not proceed to the next line.
Your code might have a cross-thread access problem. You might be getting an exception thrown, but since you're not debugging, it might be swallowed by the code elsewhere, and not shown to you, making your application appear frozen.
If you're using Threads or BackgroundWorkers in your code, you should perform operations on the UI components by checking if InvokeRequired
, and then calling Invoke
or BeginInvoke
.
精彩评论