CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #4
    Join Date
    Mar 2007
    Posts
    274

    Re: Prevent Two Decimal Points in Textbox?

    Code:
            private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
            {
                if (e.KeyChar == '.')
                {
                    if (textBox1.Text.Contains("."))
                    {
                        e.Handled = true;
                    }
                }        
            }
    Last edited by Traps; January 27th, 2009 at 05:15 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured