Click here to Skip to main content
15,905,144 members
Home / Discussions / C#
   

C#

 
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 
AnswerRe: Fastest string finding in .NET Pin
Guffa26-Oct-06 0:53
Guffa26-Oct-06 0:53 
GeneralRe: Fastest string finding in .NET Pin
Colin Angus Mackay26-Oct-06 2:31
Colin Angus Mackay26-Oct-06 2:31 
GeneralRe: Fastest string finding in .NET Pin
Pete O'Hanlon26-Oct-06 4:46
mvePete O'Hanlon26-Oct-06 4:46 
AnswerRe: Fastest string finding in .NET Pin
Guffa26-Oct-06 10:52
Guffa26-Oct-06 10:52 
GeneralRe: Fastest string finding in .NET Pin
Pete O'Hanlon27-Oct-06 1:22
mvePete O'Hanlon27-Oct-06 1:22 
GeneralRe: Fastest string finding in .NET Pin
Guffa27-Oct-06 2:09
Guffa27-Oct-06 2:09 
GeneralRe: Fastest string finding in .NET Pin
Pete O'Hanlon28-Oct-06 5:10
mvePete O'Hanlon28-Oct-06 5:10 
QuestionCreating Windows service Pin
DownBySpj26-Oct-06 0:34
DownBySpj26-Oct-06 0:34 
AnswerRe: Creating Windows service Pin
ednrgc26-Oct-06 4:26
ednrgc26-Oct-06 4:26 
QuestionProblem with using ParameterField class in CrystalReport. Pin
hdv21225-Oct-06 22:56
hdv21225-Oct-06 22:56 
AnswerRe: Problem with using ParameterField class in CrystalReport. Pin
bearfx26-Oct-06 5:42
bearfx26-Oct-06 5:42 
QuestionIs this doable? Pin
sharma sanjeev25-Oct-06 22:04
sharma sanjeev25-Oct-06 22:04 

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.