Click here to Skip to main content
15,908,264 members
Home / Discussions / C#
   

C#

 
GeneralRe: C and C# similarities!!! Need Help....Beginner!!! Pin
OriginalGriff14-Feb-14 22:50
mveOriginalGriff14-Feb-14 22:50 
AnswerRe: C and C# similarities!!! Need Help....Beginner!!! Pin
Peter Leow14-Feb-14 18:23
professionalPeter Leow14-Feb-14 18:23 
AnswerRe: C and C# similarities!!! Need Help....Beginner!!! Pin
Richard Andrew x6414-Feb-14 19:31
professionalRichard Andrew x6414-Feb-14 19:31 
AnswerRe: C and C# similarities!!! Need Help....Beginner!!! Pin
Richard MacCutchan14-Feb-14 22:46
mveRichard MacCutchan14-Feb-14 22:46 
AnswerRe: C and C# similarities!!! Need Help....Beginner!!! Pin
OriginalGriff14-Feb-14 22:56
mveOriginalGriff14-Feb-14 22:56 
QuestionCant Open SQL connection Pin
mcgurdan14-Feb-14 5:51
mcgurdan14-Feb-14 5:51 
AnswerRe: Cant Open SQL connection Pin
Ravi Bhavnani14-Feb-14 6:17
professionalRavi Bhavnani14-Feb-14 6:17 
AnswerRe: Cant Open SQL connection Pin
OriginalGriff14-Feb-14 8:45
mveOriginalGriff14-Feb-14 8:45 
AnswerRe: Cant Open SQL connection Pin
jschell14-Feb-14 10:25
jschell14-Feb-14 10:25 
QuestionHow to create a moving text up in C# 2005 ? Pin
Member 245846714-Feb-14 3:37
Member 245846714-Feb-14 3:37 
QuestionRe: How to create a moving text up in C# 2005 ? Pin
thatraja14-Feb-14 4:10
professionalthatraja14-Feb-14 4:10 
QuestionC# Path Finding Recommendations Pin
Phil_9314-Feb-14 2:57
Phil_9314-Feb-14 2:57 
AnswerRe: C# Path Finding Recommendations Pin
thatraja14-Feb-14 4:03
professionalthatraja14-Feb-14 4:03 
GeneralRe: C# Path Finding Recommendations Pin
Phil_9314-Feb-14 4:09
Phil_9314-Feb-14 4:09 
AnswerRe: C# Path Finding Recommendations Pin
Ravi Bhavnani14-Feb-14 6:18
professionalRavi Bhavnani14-Feb-14 6:18 
AnswerRe: C# Path Finding Recommendations Pin
Eddy Vluggen14-Feb-14 6:29
professionalEddy Vluggen14-Feb-14 6:29 
GeneralRe: C# Path Finding Recommendations Pin
Phil_9314-Feb-14 6:41
Phil_9314-Feb-14 6:41 
Generali want to accept only numeric value to a textbox in datagridview Pin
Ahmed Tamseer14-Feb-14 2:53
Ahmed Tamseer14-Feb-14 2:53 
AnswerRe: i want to accept only numeric value to a textbox in datagridview Pin
thatraja14-Feb-14 4:12
professionalthatraja14-Feb-14 4:12 
GeneralRe: i want to accept only numeric value to a textbox in datagridview Pin
BillWoodruff14-Feb-14 13:54
professionalBillWoodruff14-Feb-14 13:54 
While the code you will find here is used with a WinForms TextBox, not with a DataGridView, you might find some ideas you can use in the logic shown in the code for the 'KeyDown EventHandler [^]:
C#
private void tbxIntegerEntry_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyCode == Keys.Enter)
    {
        string mTxt = tbxIntegerEntry.Text;

        EnteredValue = null;

        // don't evaluate if Text is empty or only minus sign
        if (mTxt != String.Empty && mTxt != "-")
        {
            EnteredValue = Convert.ToInt64(mTxt);
            this.Hide();
        }
    }

    e.SuppressKeyPress =
    !(
        // backspace allowed
        e.KeyCode == Keys.Back
        ||
        // must not exceed length limit
        tbxIntegerEntry.Text.Length <= maxInt64Length
        &&
        // digits allowed
        char.IsDigit(Convert.ToChar(e.KeyCode))
        ||
        // minus sign allowed at position #0
        (tbxIntegerEntry.Text.Length == 0) && (e.KeyCode == Keys.OemMinus)
    );
}

“But I don't want to go among mad people,” Alice remarked.

“Oh, you can't help that,” said the Cat: “we're all mad here. I'm mad. You're mad.”

“How do you know I'm mad?” said Alice.

“You must be," said the Cat, or you wouldn't have come here.” Lewis Carroll

QuestionImpersonation Pin
i gr814-Feb-14 2:17
i gr814-Feb-14 2:17 
QuestionDirtying my hand with regular expression for first time Pin
tasumisra13-Feb-14 18:12
tasumisra13-Feb-14 18:12 
AnswerRe: Dirtying my hand with regular expression for first time Pin
OriginalGriff14-Feb-14 0:01
mveOriginalGriff14-Feb-14 0:01 
GeneralRe: Dirtying my hand with regular expression for first time Pin
tasumisra14-Feb-14 0:25
tasumisra14-Feb-14 0:25 
GeneralRe: Dirtying my hand with regular expression for first time Pin
OriginalGriff14-Feb-14 0:41
mveOriginalGriff14-Feb-14 0:41 

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.