Click here to Skip to main content
15,888,521 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Problem to communicate between forms Pin
N a v a n e e t h15-Mar-09 5:14
N a v a n e e t h15-Mar-09 5:14 
GeneralRe: Problem to communicate between forms Pin
roshihans15-Mar-09 18:12
roshihans15-Mar-09 18:12 
QuestionDelegates for instance methods between AppDomains... Pin
MrBhbk11-Mar-09 10:28
MrBhbk11-Mar-09 10:28 
QuestionSingle Textbox EventHandler for all Pin
Badboy22TR9-Mar-09 14:23
Badboy22TR9-Mar-09 14:23 
AnswerRe: Single Textbox EventHandler for all Pin
ky_rerun10-Mar-09 5:00
ky_rerun10-Mar-09 5:00 
AnswerRe: Single Textbox EventHandler for all Pin
Badboy22TR10-Mar-09 12:07
Badboy22TR10-Mar-09 12:07 
QuestionUpdating a label's text automatically? (New programmer) Pin
TabascoSauce9-Mar-09 12:50
TabascoSauce9-Mar-09 12:50 
GeneralRe: Updating a label's text automatically? (New programmer) Pin
Luc Pattyn9-Mar-09 13:09
sitebuilderLuc Pattyn9-Mar-09 13:09 
Hi,

you're pretty close. Your question is clear, except for the "it doesn't work" which is too vague. You probably mean: I never got the sum to show at all, my program simply freezes.

AFAIK your main problem is this: you have a do-while loop inside the handler, so for positive sums it will never exit, hence the new sum also does not become visible.
Experiment: enter 0, 0, and -1

Throw away the do-while all together; the handler should calculate the sum only once each time your event fires (not sure what it is connected to).

Further improvements:
- either add a try-catch construct to deal with bad input, or start using double.TryParse
- to restrict user input, you could wire TextChanged handlers to the TextBoxes, but it is rather hard to deal with all the details (minus signs, plus signs, exponents, periods, comma's, and editing, copy/pasting, etc). The TryParse method basically takes care of it all.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


GeneralRe: Updating a label's text automatically? (New programmer) Pin
TabascoSauce9-Mar-09 14:10
TabascoSauce9-Mar-09 14:10 
QuestionInt64 minus.... Pin
Thilek8-Mar-09 6:46
Thilek8-Mar-09 6:46 
AnswerRe: Int64 minus.... Pin
Mark Salsbery8-Mar-09 9:19
Mark Salsbery8-Mar-09 9:19 
AnswerRe: Int64 minus.... Pin
Dave Doknjas8-Mar-09 13:56
Dave Doknjas8-Mar-09 13:56 
Question(C++/CLI) "FileNotFoundException" raised in "Activator::GetObject()" method of Remoting programming Pin
zkii4-Mar-09 3:08
zkii4-Mar-09 3:08 
AnswerRe: (C++/CLI) "FileNotFoundException" raised in "Activator::GetObject()" method of Remoting programming Pin
led mike4-Mar-09 4:41
led mike4-Mar-09 4:41 
GeneralRe: (C++/CLI) "FileNotFoundException" raised in "Activator::GetObject()" method of Remoting programming Pin
zkii4-Mar-09 16:54
zkii4-Mar-09 16:54 
GeneralRe: (C++/CLI) "FileNotFoundException" raised in "Activator::GetObject()" method of Remoting programming Pin
led mike5-Mar-09 4:28
led mike5-Mar-09 4:28 
GeneralRe: (C++/CLI) "FileNotFoundException" raised in "Activator::GetObject()" method of Remoting programming Pin
zkii5-Mar-09 16:02
zkii5-Mar-09 16:02 
GeneralRe: (C++/CLI) "FileNotFoundException" raised in "Activator::GetObject()" method of Remoting programming Pin
led mike6-Mar-09 4:47
led mike6-Mar-09 4:47 
QuestionStreamReader delimiters in C++/CLI Pin
J_E_D_I3-Mar-09 22:14
J_E_D_I3-Mar-09 22:14 
AnswerRe: StreamReader delimiters in C++/CLI Pin
ky_rerun5-Mar-09 6:50
ky_rerun5-Mar-09 6:50 
AnswerRe: StreamReader delimiters in C++/CLI Pin
dybs6-Mar-09 17:58
dybs6-Mar-09 17:58 
QuestionRe: StreamReader delimiters in C++/CLI Pin
J_E_D_I16-Mar-09 7:06
J_E_D_I16-Mar-09 7:06 
AnswerRe: StreamReader delimiters in C++/CLI Pin
dybs16-Mar-09 13:21
dybs16-Mar-09 13:21 
GeneralRe: StreamReader delimiters in C++/CLI Pin
J_E_D_I25-Mar-09 11:19
J_E_D_I25-Mar-09 11:19 
GeneralRe: StreamReader delimiters in C++/CLI Pin
dybs25-Mar-09 15:33
dybs25-Mar-09 15:33 

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.