首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

帮小弟我看看,progressBar.Value的有关问题

2012-03-19 
帮我看看,progressBar.Value的问题我编写了一段程序:结果编译的时候提示D:\studyofC#\ConsoleApplication1

帮我看看,progressBar.Value的问题
我编写了一段程序:结果编译的时候提示
D:\study   of   C#\ConsoleApplication1\ThreadOP\ThreadOP\Form2.cs(106):   检测到无法访问的代码。即progressBar1.Value   %=progressBar1.Maximum;中的progressBar无法访问。请问这个怎么解决。谢谢,代码如下:

public   void   MyCalculate()
{
double   k;
while(true)
{
for(int   i=0;i <1000;i++)
{
for(int   j=0;j <1000;j++)
  k=123.456;
}
}
progressBar1.Value   %=progressBar1.Maximum;
progressBar1.Value++;
}

[解决办法]
while(true)
{
for(int i=0;i <1000;i++)
{
for(int j=0;j <1000;j++)
k=123.456;
}
}
这个循环是死循环,无法结束。所以后面的代码无法被执行到。
[解决办法]
.NET技术群12845737.
大量学习资料下载.

讨论VC/C#/ASP.NET/FLASH_AS技术

欢迎学习和技术人员加入
探讨技术,分享程序员生活.
[解决办法]
死循环,当然会有执行不到下面的代码了.

热点排行