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

Threaded View

  1. #1
    Join Date
    Nov 2010
    Posts
    139

    how to check if numbers and letters are entered in a textbox

    how do i check textboxes to see whether the user has entered letters, symbols and/or integers? My program requires the user to enter atleast one numeric value, if they don't enter atleast one number then an error message will show. i have tried the following but had no luck:

    // checks password for letters

    private: System::Boolean ValidateInput()

    {

    if (password != "0-9")
    {
    ShowMessage("password must contain atleast one numeric value (0-9).");
    // clear text boxes
    txtPassword->Text = "";
    txtRePassword->Text = "";
    }
    }

    any help will be appreciated thanks
    Last edited by katy_price; November 16th, 2010 at 04:35 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