Click here to Skip to main content
15,887,175 members
Home / Discussions / C#
   

C#

 
AnswerRe: WPF: Add child node to TreeView for other thread Pin
Dave Kreskowiak21-Apr-13 4:14
mveDave Kreskowiak21-Apr-13 4:14 
GeneralRe: WPF: Add child node to TreeView for other thread Pin
Boltian6-May-13 6:43
Boltian6-May-13 6:43 
GeneralRe: WPF: Add child node to TreeView for other thread Pin
Dave Kreskowiak6-May-13 7:34
mveDave Kreskowiak6-May-13 7:34 
Questionerro ao fazer um calculo deixando o campo desconto vazio! Pin
Member 1000184520-Apr-13 17:55
Member 1000184520-Apr-13 17:55 
AnswerRe: erro ao fazer um calculo deixando o campo desconto vazio! Pin
PIEBALDconsult20-Apr-13 18:04
mvePIEBALDconsult20-Apr-13 18:04 
AnswerRe: erro ao fazer um calculo deixando o campo desconto vazio! Pin
OriginalGriff20-Apr-13 21:58
mveOriginalGriff20-Apr-13 21:58 
GeneralRe: erro ao fazer um calculo deixando o campo desconto vazio! Pin
Member 1000184524-Apr-13 13:03
Member 1000184524-Apr-13 13:03 
GeneralRe: erro ao fazer um calculo deixando o campo desconto vazio! Pin
OriginalGriff24-Apr-13 21:52
mveOriginalGriff24-Apr-13 21:52 
Laugh | :laugh: You don't have to do that: TryParse attempts to do the conversion, and if if succeeds, it returns the value in the out parameter, and true as the result. If it fails, it returns false, and deosn't touch the parameter.
Normally, you would want to report a problem when the user enters a bad value (otherwise he will assume it is correct and using his values):
C#
if (!double.TryParse(txtValorUnitario.Text, out valorUnitario))
   {
   MessageBox.Show("Please enter a number!");
   return;
   }
But if you don't you still don't need to convert the value once you have checked:
C#
double valorUnitario = 0;
double.TryParse(txtValorUnitario.Text, out valorUnitario);
And ignore the returned result. You will get 0 if the textbox is bad, or the value if it is good.
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)

GeneralRe: erro ao fazer um calculo deixando o campo desconto vazio! Pin
Member 1000184524-Apr-13 23:42
Member 1000184524-Apr-13 23:42 
GeneralRe: erro ao fazer um calculo deixando o campo desconto vazio! Pin
OriginalGriff25-Apr-13 0:19
mveOriginalGriff25-Apr-13 0:19 
GeneralRe: erro ao fazer um calculo deixando o campo desconto vazio! Pin
Member 1000184526-Apr-13 11:58
Member 1000184526-Apr-13 11:58 
GeneralRe: erro ao fazer um calculo deixando o campo desconto vazio! Pin
OriginalGriff26-Apr-13 21:39
mveOriginalGriff26-Apr-13 21:39 
QuestionIs monodevelo suitable for a digital pet project in linux? Pin
eleazaro20-Apr-13 10:26
eleazaro20-Apr-13 10:26 
AnswerRe: Is monodevelo suitable for a digital pet project in linux? Pin
jschell21-Apr-13 6:02
jschell21-Apr-13 6:02 
AnswerRe: Is monodevelo suitable for a digital pet project in linux? Pin
Eddy Vluggen21-Apr-13 9:06
professionalEddy Vluggen21-Apr-13 9:06 
Questionexample for using webrequest and webresopnse Pin
arashmousapour20-Apr-13 2:37
arashmousapour20-Apr-13 2:37 
AnswerRe: example for using webrequest and webresopnse Pin
Mycroft Holmes20-Apr-13 13:56
professionalMycroft Holmes20-Apr-13 13:56 
QuestionDev platform for Kinect Pin
hanzibal219-Apr-13 23:18
hanzibal219-Apr-13 23:18 
QuestionVS C# Application Choice Pin
MWRivera19-Apr-13 12:13
MWRivera19-Apr-13 12:13 
AnswerRe: VS C# Application Choice Pin
NotPolitcallyCorrect19-Apr-13 14:10
NotPolitcallyCorrect19-Apr-13 14:10 
AnswerRe: VS C# Application Choice Pin
Yvan Rodrigues19-Apr-13 14:11
professionalYvan Rodrigues19-Apr-13 14:11 
AnswerRe: VS C# Application Choice Pin
Garth J Lancaster19-Apr-13 14:12
professionalGarth J Lancaster19-Apr-13 14:12 
AnswerRe: VS C# Application Choice Pin
Karthik Harve19-Apr-13 20:24
professionalKarthik Harve19-Apr-13 20:24 
AnswerRe: VS C# Application Choice Pin
Abhinav S19-Apr-13 23:23
Abhinav S19-Apr-13 23:23 
AnswerRe: VS C# Application Choice Pin
MWRivera22-Apr-13 3:42
MWRivera22-Apr-13 3:42 

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.