Click here to Skip to main content
15,028,757 members
Home / Discussions / C#
   

C#

 
GeneralRe: Passing parameter from one page to another Pin
Richard Andrew x6428-Jun-21 14:23
professionalRichard Andrew x6428-Jun-21 14:23 
GeneralRe: Passing parameter from one page to another Pin
Richard MacCutchan28-Jun-21 21:13
mveRichard MacCutchan28-Jun-21 21:13 
GeneralRe: Passing parameter from one page to another Pin
Alex Dunlop29-Jun-21 4:53
MemberAlex Dunlop29-Jun-21 4:53 
GeneralRe: Passing parameter from one page to another Pin
Richard MacCutchan29-Jun-21 5:44
mveRichard MacCutchan29-Jun-21 5:44 
QuestionCreate the same but in windows form C# Pin
Luis M. Rojas25-Jun-21 6:16
MemberLuis M. Rojas25-Jun-21 6:16 
AnswerRe: Create the same but in windows form C# Pin
OriginalGriff25-Jun-21 6:23
mveOriginalGriff25-Jun-21 6:23 
QuestionDifficulty adding code to reject non numeric user inputs Pin
Member 1524886723-Jun-21 5:58
MemberMember 1524886723-Jun-21 5:58 
AnswerRe: Difficulty adding code to reject non numeric user inputs Pin
OriginalGriff23-Jun-21 6:08
mveOriginalGriff23-Jun-21 6:08 
First off, stop using Convert functions on user input - they are designed to throw an exception if the value is not numeric, and that means when your user misstypes your app crashes.
Use the TryParse methods instead, and exit the function when it fails:
C#
double presentValue;
if (!double.TryParse(txtPresentValue.Text, out presentValue))
   {
   MessageBox.Show("Present value must be a numeric value");
   return;
   }
Then you can add your validations, and again return if they do not succeed.

A better way is to use a NumericUpDown control instead of a textbox as the user can't enter invalid numbers into them at all...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Difficulty adding code to reject non numeric user inputs Pin
Member 1524886723-Jun-21 7:15
MemberMember 1524886723-Jun-21 7:15 
GeneralRe: Difficulty adding code to reject non numeric user inputs Pin
OriginalGriff23-Jun-21 7:32
mveOriginalGriff23-Jun-21 7:32 
GeneralLimitless printing Pin
Member 1419221622-Jun-21 1:21
MemberMember 1419221622-Jun-21 1:21 
GeneralRe: Limitless printing Pin
OriginalGriff22-Jun-21 2:26
mveOriginalGriff22-Jun-21 2:26 
GeneralRe: Limitless printing Pin
jsc4222-Jun-21 3:04
professionaljsc4222-Jun-21 3:04 
GeneralRe: Limitless printing Pin
Gerry Schmitz22-Jun-21 6:57
mveGerry Schmitz22-Jun-21 6:57 
QuestionC# graph/diagram showing executing tasks vs time, that scales well with large data sets? Pin
arnold_w21-Jun-21 21:23
Memberarnold_w21-Jun-21 21:23 
AnswerRe: C# graph/diagram showing executing tasks vs time, that scales well with large data sets? Pin
Gerry Schmitz22-Jun-21 6:43
mveGerry Schmitz22-Jun-21 6:43 
AnswerRe: C# graph/diagram showing executing tasks vs time, that scales well with large data sets? Pin
BillWoodruff22-Jun-21 19:02
mveBillWoodruff22-Jun-21 19:02 
GeneralRe: C# graph/diagram showing executing tasks vs time, that scales well with large data sets? Pin
Gerry Schmitz23-Jun-21 7:26
mveGerry Schmitz23-Jun-21 7:26 
GeneralRe: C# graph/diagram showing executing tasks vs time, that scales well with large data sets? Pin
BillWoodruff23-Jun-21 23:27
mveBillWoodruff23-Jun-21 23:27 
GeneralRe: C# graph/diagram showing executing tasks vs time, that scales well with large data sets? Pin
Gerry Schmitz24-Jun-21 6:27
mveGerry Schmitz24-Jun-21 6:27 
QuestionLinking forms Pin
Member 1524886721-Jun-21 12:15
MemberMember 1524886721-Jun-21 12:15 
AnswerRe: Linking forms Pin
Richard Andrew x6421-Jun-21 13:22
professionalRichard Andrew x6421-Jun-21 13:22 
GeneralRe: Linking forms Pin
Member 1524886721-Jun-21 13:31
MemberMember 1524886721-Jun-21 13:31 
GeneralRe: Linking forms Pin
Richard Andrew x6421-Jun-21 13:43
professionalRichard Andrew x6421-Jun-21 13:43 
GeneralRe: Linking forms Pin
Member 1524886721-Jun-21 15:23
MemberMember 1524886721-Jun-21 15:23 

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.