Click here to Skip to main content
15,885,546 members
Home / Discussions / C#
   

C#

 
GeneralRe: C # + Regex help (for a newbie) Pin
OriginalGriff27-Dec-17 6:23
mveOriginalGriff27-Dec-17 6:23 
GeneralRe: C # + Regex help (for a newbie) Pin
Nathan Minier27-Dec-17 6:34
professionalNathan Minier27-Dec-17 6:34 
GeneralRe: C # + Regex help (for a newbie) Pin
OriginalGriff27-Dec-17 6:40
mveOriginalGriff27-Dec-17 6:40 
GeneralRe: C # + Regex help (for a newbie) Pin
Nathan Minier27-Dec-17 6:56
professionalNathan Minier27-Dec-17 6:56 
GeneralRe: C # + Regex help (for a newbie) Pin
Damian Bz27-Dec-17 6:24
Damian Bz27-Dec-17 6:24 
GeneralRe: C # + Regex help (for a newbie) Pin
OriginalGriff27-Dec-17 6:28
mveOriginalGriff27-Dec-17 6:28 
GeneralRe: C # + Regex help (for a newbie) Pin
Damian Bz27-Dec-17 6:18
Damian Bz27-Dec-17 6:18 
GeneralRe: C # + Regex help (for a newbie) Pin
OriginalGriff27-Dec-17 6:26
mveOriginalGriff27-Dec-17 6:26 
Don't bother with a regex.
Change the int.TryParse to double.TryParse (and the values to doubles as well) and it validates and converts them at the same time.
When they are all validated, you have a collections of doubles you can use for your calculations, and yes, the validations can be floating point:
C#
double value;
if (!(double.TryParse(myTextBox.Text, out value) && value >= 0.1 && value <= 2.9))
   {
   MessageBox.Show("Please enter a number between 0.1 and 2.9");
   ...
   return;
   }

Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

GeneralRe: C # + Regex help (for a newbie) Pin
Damian Bz27-Dec-17 6:29
Damian Bz27-Dec-17 6:29 
GeneralRe: C # + Regex help (for a newbie) Pin
Damian Bz27-Dec-17 7:37
Damian Bz27-Dec-17 7:37 
GeneralRe: C # + Regex help (for a newbie) Pin
Damian Bz27-Dec-17 9:15
Damian Bz27-Dec-17 9:15 
GeneralRe: C # + Regex help (for a newbie) Pin
Richard MacCutchan27-Dec-17 21:56
mveRichard MacCutchan27-Dec-17 21:56 
GeneralRe: C # + Regex help (for a newbie) Pin
OriginalGriff28-Dec-17 1:51
mveOriginalGriff28-Dec-17 1:51 
GeneralRe: C # + Regex help (for a newbie) Pin
Damian Bz28-Dec-17 6:59
Damian Bz28-Dec-17 6:59 
AnswerRe: C # + Regex help (for a newbie) Pin
Gerry Schmitz28-Dec-17 8:17
mveGerry Schmitz28-Dec-17 8:17 
GeneralRe: C # + Regex help (for a newbie) Pin
Damian Bz28-Dec-17 23:21
Damian Bz28-Dec-17 23:21 
GeneralRe: C # + Regex help (for a newbie) Pin
Damian Bz29-Dec-17 1:48
Damian Bz29-Dec-17 1:48 
GeneralRe: C # + Regex help (for a newbie) Pin
Gerry Schmitz29-Dec-17 6:03
mveGerry Schmitz29-Dec-17 6:03 
QuestionSet datagrid cell value individually and dynamically Pin
Hervend26-Dec-17 22:17
Hervend26-Dec-17 22:17 
AnswerRe: Set datagrid cell value individually and dynamically Pin
Richard MacCutchan26-Dec-17 22:37
mveRichard MacCutchan26-Dec-17 22:37 
GeneralRe: Set datagrid cell value individually and dynamically Pin
Hervend26-Dec-17 22:52
Hervend26-Dec-17 22:52 
GeneralRe: Set datagrid cell value individually and dynamically Pin
Pete O'Hanlon26-Dec-17 22:56
mvePete O'Hanlon26-Dec-17 22:56 
GeneralRe: Set datagrid cell value individually and dynamically Pin
Hervend26-Dec-17 23:37
Hervend26-Dec-17 23:37 
GeneralRe: Set datagrid cell value individually and dynamically Pin
Richard MacCutchan26-Dec-17 23:29
mveRichard MacCutchan26-Dec-17 23:29 
GeneralRe: Set datagrid cell value individually and dynamically Pin
Hervend26-Dec-17 23:35
Hervend26-Dec-17 23:35 

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.