Click here to Skip to main content
15,904,828 members
Home / Discussions / C#
   

C#

 
AnswerRe: why I get a weird exception when I call setFocus? The exception is called as "Collection was modified; enumeration operation may not execute." Pin
Dave Kreskowiak22-Dec-05 15:40
mveDave Kreskowiak22-Dec-05 15:40 
GeneralRe: why I get a weird exception when I call setFocus? The exception is called as "Collection was modified; enumeration operation may not execute." Pin
jerryyag23-Dec-05 5:37
jerryyag23-Dec-05 5:37 
GeneralRe: why I get a weird exception when I call setFocus? The exception is called as "Collection was modified; enumeration operation may not execute." Pin
Dave Kreskowiak26-Dec-05 5:56
mveDave Kreskowiak26-Dec-05 5:56 
QuestionMSN Options dynamic groupBox Pin
zopiro22-Dec-05 8:44
zopiro22-Dec-05 8:44 
QuestionBreak long line of code into short lines Pin
devinzhang22-Dec-05 8:17
devinzhang22-Dec-05 8:17 
AnswerRe: Break long line of code into short lines Pin
Stanciu Vlad22-Dec-05 10:22
Stanciu Vlad22-Dec-05 10:22 
GeneralRe: Break long line of code into short lines Pin
devinzhang22-Dec-05 15:36
devinzhang22-Dec-05 15:36 
Questionshows program status Pin
zhujp9822-Dec-05 6:37
zhujp9822-Dec-05 6:37 
	<br />
    int i;<br />
    Form2 f2=new Form2();<br />
    //some code<br />
    <br />
     private void button1_Click(object sender, System.EventArgs e)<br />
    {<br />
	f2.Show();<br />
	f2.textBox1.Text=i.ToString();<br />
           //textBox1 was decleared public in form2<br />
        loop();<br />
     }<br />
     private void loop()<br />
     {<br />
	for(i=1; i<1000000;i++)<br />
	{<br />
	   f2.textBox1.Text=i.ToString();<br />
	   f2.Refresh();<br />
	}<br />
		<br />
     }<br />
<br />
<br />
<br />


With above code, I want to let i show in the testbox1 of form2 while the interation in funcion loop in going on. When I run the program. at first it works, but after i get to around 10000, the form2 freezs,and it will not update the value of i. If I click the form. The form2 's text will show some thing like ( not responding).
How can I fix this problem?

Thank.
AnswerRe: shows program status Pin
Stanciu Vlad22-Dec-05 7:01
Stanciu Vlad22-Dec-05 7:01 
GeneralRe: shows program status Pin
zhujp9822-Dec-05 7:04
zhujp9822-Dec-05 7:04 
GeneralRe: shows program status Pin
Stanciu Vlad22-Dec-05 7:08
Stanciu Vlad22-Dec-05 7:08 
GeneralRe: shows program status Pin
Curtis Schlak.22-Dec-05 7:27
Curtis Schlak.22-Dec-05 7:27 
AnswerRe: shows program status Pin
Dave Kreskowiak22-Dec-05 15:34
mveDave Kreskowiak22-Dec-05 15:34 
QuestionDataGrid updates from a combo box in C# Pin
AuZi200522-Dec-05 6:26
AuZi200522-Dec-05 6:26 
AnswerRe: DataGrid updates from a combo box in C# Pin
Stanciu Vlad22-Dec-05 7:04
Stanciu Vlad22-Dec-05 7:04 
GeneralRe: DataGrid updates from a combo box in C# Pin
AuZi200522-Dec-05 8:15
AuZi200522-Dec-05 8:15 
QuestionWinforms, Datagrids, Hyperlinks and Excel Pin
scotlandc22-Dec-05 6:25
scotlandc22-Dec-05 6:25 
QuestionMenu like functionality Pin
VPMahank22-Dec-05 5:23
VPMahank22-Dec-05 5:23 
Questionopen a excel interface in my c# form Pin
Sasuko22-Dec-05 5:04
Sasuko22-Dec-05 5:04 
AnswerRe: open a excel interface in my c# form Pin
KaptinKrunch22-Dec-05 7:09
KaptinKrunch22-Dec-05 7:09 
QuestionBook Pin
fmardani22-Dec-05 4:41
fmardani22-Dec-05 4:41 
QuestionAuto Update for my application Pin
.NetRocker22-Dec-05 4:35
.NetRocker22-Dec-05 4:35 
AnswerRe: Auto Update for my application Pin
J4amieC22-Dec-05 5:34
J4amieC22-Dec-05 5:34 
AnswerRe: Auto Update for my application Pin
Xodiak22-Dec-05 10:57
Xodiak22-Dec-05 10:57 
GeneralRe: Auto Update for my application Pin
.NetRocker23-Dec-05 5:47
.NetRocker23-Dec-05 5:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.