Click here to Skip to main content
15,907,906 members
Home / Discussions / C#
   

C#

 
QuestionHow to detect Attempt to connect? Pin
FlyOnIT21-Oct-06 9:52
FlyOnIT21-Oct-06 9:52 
AnswerRe: How to detect Attempt to connect? Pin
LongRange.Shooter23-Oct-06 4:32
LongRange.Shooter23-Oct-06 4:32 
QuestionNeed To license source or component. Pin
hdv21221-Oct-06 8:44
hdv21221-Oct-06 8:44 
QuestionHow to identify whether or not a control object has been instantiated... [modified] Pin
new_phoenix21-Oct-06 7:46
new_phoenix21-Oct-06 7:46 
AnswerRe: How to identify whether or not a control object has been instantiated... Pin
Guffa21-Oct-06 8:59
Guffa21-Oct-06 8:59 
GeneralRe: How to identify whether or not a control object has been instantiated... [modified] Pin
new_phoenix21-Oct-06 9:28
new_phoenix21-Oct-06 9:28 
GeneralRe: How to identify whether or not a control object has been instantiated... Pin
Guffa21-Oct-06 11:56
Guffa21-Oct-06 11:56 
QuestionForm Updating within Loops Pin
Jethro6321-Oct-06 6:06
Jethro6321-Oct-06 6:06 
Greetings:

I am a relatively new C# programmer and I have written a naive little utility which performs a task within a loop. This program is simple and the loop executes inside a routine belonging to the main form. The task that the loop performs does take some time though, maybe a few minutes, depending on various settings.

What I wanted, and this is the naive part, was to put some controls on the main form that update the user as to the status of the process. These are mostly just text boxes. When I want to update one or all of the text controls, I write the new string to the control's "Text" property.

What I have found though is that the form sometimes updates, but can go into this strange state of limbo where it simply stops updating or sometimes even goes blank. The main loop is still executing and the form will come back to life once the loop is finished. But I wanted the form to update continually throughout the process. I have also found that the form will update itself at first but if I click the mouse pointer on it or attempt to move the form on the display, then it freezes instantly and does not come back until the loop is finished.

I am an experienced MFC programmer and I know that this kind of thing happens if you fail to service the "message pump" from within loops of this sort. Have I missed something similar here? Or is this little utility simply an architectural accident-waiting-to-happen?

If the later is true, then what must I do to implement a long looping process that provides continually refreshed status to the user interface? Can you point me to books or articles?

Thanks in advance to anyone that responds
Mark


AnswerRe: Form Updating within Loops Pin
User 665821-Oct-06 6:41
User 665821-Oct-06 6:41 
GeneralRe: Form Updating within Loops Pin
Jethro6321-Oct-06 19:19
Jethro6321-Oct-06 19:19 
QuestionHow to make an number only text box? Pin
Ming Luo21-Oct-06 5:50
Ming Luo21-Oct-06 5:50 
AnswerRe: How to make an number only text box? Pin
User 665821-Oct-06 6:44
User 665821-Oct-06 6:44 
AnswerRe: How to make an number only text box? Pin
3Dizard21-Oct-06 10:12
3Dizard21-Oct-06 10:12 
GeneralRe: How to make an number only text box? Pin
Martin2323-Oct-06 0:18
Martin2323-Oct-06 0:18 
Questionhow to Genarate report ??? Pin
iyoko21-Oct-06 5:38
iyoko21-Oct-06 5:38 
Questionhow retrieve data from Cookie?? Pin
iyoko21-Oct-06 5:36
iyoko21-Oct-06 5:36 
AnswerRe: how retrieve data from Cookie?? Pin
Guffa21-Oct-06 6:51
Guffa21-Oct-06 6:51 
GeneralRe: how retrieve data from Cookie?? Pin
iyoko21-Oct-06 22:43
iyoko21-Oct-06 22:43 
QuestionNetwork System.Net.Dns.GetHostByAddress is too slow Pin
bradsnobar20-Oct-06 21:55
bradsnobar20-Oct-06 21:55 
AnswerRe: Network System.Net.Dns.GetHostByAddress is too slow Pin
User 665820-Oct-06 23:43
User 665820-Oct-06 23:43 
QuestionHow to safely raname a vs 2005 project Pin
_marsim_20-Oct-06 21:17
_marsim_20-Oct-06 21:17 
Questione of godgames Pin
ammoh20-Oct-06 21:14
ammoh20-Oct-06 21:14 
QuestionRe: e of godgames Pin
ammoh20-Oct-06 21:21
ammoh20-Oct-06 21:21 
AnswerRe: e of godgames Pin
Vega0221-Oct-06 17:07
Vega0221-Oct-06 17:07 
AnswerRe: e of godgames Pin
LongRange.Shooter23-Oct-06 4:36
LongRange.Shooter23-Oct-06 4:36 

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.