Click here to Skip to main content
15,921,577 members
Home / Discussions / C#
   

C#

 
AnswerRe: using stringbuilder Pin
ednrgc26-Oct-06 4:12
ednrgc26-Oct-06 4:12 
AnswerRe: using stringbuilder Pin
Pete O'Hanlon26-Oct-06 6:44
mvePete O'Hanlon26-Oct-06 6:44 
QuestionStreamReader problem Pin
Tavbi26-Oct-06 3:08
Tavbi26-Oct-06 3:08 
AnswerRe: StreamReader problem Pin
Andrew Rissing26-Oct-06 3:17
Andrew Rissing26-Oct-06 3:17 
GeneralRe: StreamReader problem Pin
Tavbi26-Oct-06 20:44
Tavbi26-Oct-06 20:44 
GeneralRe: StreamReader problem Pin
Andrew Rissing27-Oct-06 3:30
Andrew Rissing27-Oct-06 3:30 
AnswerRe: StreamReader problem Pin
ednrgc26-Oct-06 3:20
ednrgc26-Oct-06 3:20 
GeneralRe: StreamReader problem Pin
Tavbi26-Oct-06 20:38
Tavbi26-Oct-06 20:38 
QuestionMaking desktop application resolution independent? Pin
Mridang Agarwalla26-Oct-06 2:43
Mridang Agarwalla26-Oct-06 2:43 
AnswerRe: Making desktop application resolution independent? Pin
Pete O'Hanlon26-Oct-06 4:34
mvePete O'Hanlon26-Oct-06 4:34 
QuestionCreating Setup Pin
Jad Jadallah26-Oct-06 2:21
Jad Jadallah26-Oct-06 2:21 
Questionmultithreaded GUI Pin
Polar2226-Oct-06 1:41
Polar2226-Oct-06 1:41 
AnswerRe: multithreaded GUI Pin
billard26-Oct-06 1:52
billard26-Oct-06 1:52 
GeneralRe: multithreaded GUI Pin
Polar2226-Oct-06 1:56
Polar2226-Oct-06 1:56 
AnswerRe: multithreaded GUI Pin
ednrgc26-Oct-06 3:27
ednrgc26-Oct-06 3:27 
QuestionConvert Graphics to Image Pin
topcatalpha26-Oct-06 1:36
topcatalpha26-Oct-06 1:36 
AnswerRe: Convert Graphics to Image Pin
topcatalpha26-Oct-06 22:20
topcatalpha26-Oct-06 22:20 
Questionregular expression validator Pin
vijeta_r26-Oct-06 1:16
vijeta_r26-Oct-06 1:16 
AnswerRe: regular expression validator Pin
Guffa26-Oct-06 1:38
Guffa26-Oct-06 1:38 
AnswerRe: regular expression validator Pin
NTSubuu22-May-12 19:28
NTSubuu22-May-12 19:28 
I have a Qty field in the grid. To validate this field i have used the code given at the end.
I tried various regular expressions representing decimal value, but none is working.
For all the cases, for '.' e.handled is set true. So, i am not able to get '.' as input. Can anyone help me:

C#
private void tb_KeyPress(object sender, KeyPressEventArgs e)
{
    string regexstring = @"(\d+)|(\d*\.\d{1,2})";

    //Regex reg = new Regex("^[0-9]+.[0-9]*");
    Regex reg = new Regex(regexstring);
    //Regex reg = new Regex("(\d+)|(\d*\.\d{1,2})");
    //Regex reg = new Regex("^[A-Za-z]+\\w*");
    if (reg.IsMatch(Convert.ToString(e.KeyChar)))
    {
        e.Handled = false;
    }
    else
    {
            e.Handled = true;
    }
}

QuestionFuzzy Word Experiment sample [modified] Pin
ranatunga26-Oct-06 0:53
ranatunga26-Oct-06 0:53 
QuestionFileMode.Create? Pin
scotlandc26-Oct-06 0:51
scotlandc26-Oct-06 0:51 
AnswerRe: FileMode.Create? Pin
ednrgc26-Oct-06 4:31
ednrgc26-Oct-06 4:31 
Questionhelp how to give privilege to programm !!! Pin
vincent3126-Oct-06 0:49
vincent3126-Oct-06 0:49 
QuestionFastest string finding in .NET Pin
Colin Angus Mackay26-Oct-06 0:39
Colin Angus Mackay26-Oct-06 0:39 

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.