Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved C#
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    g_hemanth17
    wrote on last edited by
    #1

    [Message Deleted]

    A M 3 Replies Last reply
    0
    • G g_hemanth17

      [Message Deleted]

      A Offline
      A Offline
      Adeel Chaudhry
      wrote on last edited by
      #2

      It was going pretty well, till ....

      g_hemanth17 wrote:

      Can any one send me the code

      Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.

      1 Reply Last reply
      0
      • G g_hemanth17

        [Message Deleted]

        M Offline
        M Offline
        madhugurukul
        wrote on last edited by
        #3

        use masked text box it will help u:)

        1 Reply Last reply
        0
        • G g_hemanth17

          [Message Deleted]

          A Offline
          A Offline
          Adeel Chaudhry
          wrote on last edited by
          #4

          Thankyou very much for this email, but may i know what is that for? And what am i supposed to do with this? Email i just received is as follows: This is a direct email response to your message on the page "C#". This message has not appeared on the discussion board for that page. Message from g_hemanth17 <*Email Deleted*>: i have used this chunk of code for taking only positive decimal and interger values, it worked successfully for me. you can modify it according to your need. it is basically keypress event of textbox... /////////////////////////////////////////////////////////////////////////////// private void onKeyPress(object sender, KeyPressEventArgs e) { char[] myNum = new char[12] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '\b','.' }; bool blnNumFnd = false; //for keeping track of decimal foreach (char c in myNum) { if (e.KeyChar == myNum[11]) { String txt = ((TextBox)sender).Text; if (!txt.Contains(".")) { blnNumFnd = true; //means its decimal value and user can't enter another decimal again! break; } } else if (e.KeyChar == c) { blnNumFnd = true; break; } } if (!blnNumFnd) e.KeyChar = '\0'; } --------------- it will take . for only 1 time..like this i want for + and - in the same text box can u try it hemanth

          Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.

          C 2 Replies Last reply
          0
          • A Adeel Chaudhry

            Thankyou very much for this email, but may i know what is that for? And what am i supposed to do with this? Email i just received is as follows: This is a direct email response to your message on the page "C#". This message has not appeared on the discussion board for that page. Message from g_hemanth17 <*Email Deleted*>: i have used this chunk of code for taking only positive decimal and interger values, it worked successfully for me. you can modify it according to your need. it is basically keypress event of textbox... /////////////////////////////////////////////////////////////////////////////// private void onKeyPress(object sender, KeyPressEventArgs e) { char[] myNum = new char[12] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '\b','.' }; bool blnNumFnd = false; //for keeping track of decimal foreach (char c in myNum) { if (e.KeyChar == myNum[11]) { String txt = ((TextBox)sender).Text; if (!txt.Contains(".")) { blnNumFnd = true; //means its decimal value and user can't enter another decimal again! break; } } else if (e.KeyChar == c) { blnNumFnd = true; break; } } if (!blnNumFnd) e.KeyChar = '\0'; } --------------- it will take . for only 1 time..like this i want for + and - in the same text box can u try it hemanth

            Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Here's the problem. First of all, you asked this once before and got a ton of responses. If you can't work out how to follow our advice, then give up what you're doing, buy a book and learn some C# so you're capable of taking advice. Second, while this solution is pretty nasty, it should put you on the right track to taking the advice I gave you earlier today.

            Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            1 Reply Last reply
            0
            • A Adeel Chaudhry

              Thankyou very much for this email, but may i know what is that for? And what am i supposed to do with this? Email i just received is as follows: This is a direct email response to your message on the page "C#". This message has not appeared on the discussion board for that page. Message from g_hemanth17 <*Email Deleted*>: i have used this chunk of code for taking only positive decimal and interger values, it worked successfully for me. you can modify it according to your need. it is basically keypress event of textbox... /////////////////////////////////////////////////////////////////////////////// private void onKeyPress(object sender, KeyPressEventArgs e) { char[] myNum = new char[12] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '\b','.' }; bool blnNumFnd = false; //for keeping track of decimal foreach (char c in myNum) { if (e.KeyChar == myNum[11]) { String txt = ((TextBox)sender).Text; if (!txt.Contains(".")) { blnNumFnd = true; //means its decimal value and user can't enter another decimal again! break; } } else if (e.KeyChar == c) { blnNumFnd = true; break; } } if (!blnNumFnd) e.KeyChar = '\0'; } --------------- it will take . for only 1 time..like this i want for + and - in the same text box can u try it hemanth

              Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              Here's the problem. First of all, you asked this once before and got a ton of responses. If you can't work out how to follow our advice, then give up what you're doing, buy a book and learn some C# so you're capable of taking advice. Second, while this solution is pretty nasty, it should put you on the right track to taking the advice I gave you earlier today. Finally, when someone takes the time to do your job for you, you should show some gratitude instead of complaining that it doesn't do the job you're being paid to do and cannot work out for yourself.

              Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

              A 1 Reply Last reply
              0
              • C Christian Graus

                Here's the problem. First of all, you asked this once before and got a ton of responses. If you can't work out how to follow our advice, then give up what you're doing, buy a book and learn some C# so you're capable of taking advice. Second, while this solution is pretty nasty, it should put you on the right track to taking the advice I gave you earlier today. Finally, when someone takes the time to do your job for you, you should show some gratitude instead of complaining that it doesn't do the job you're being paid to do and cannot work out for yourself.

                Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

                A Offline
                A Offline
                Adeel Chaudhry
                wrote on last edited by
                #7

                I second you Christian :) That surely is not the right way of using the "" link!! Thanks for the support. Regards, Adeel

                Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups