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

Threaded View

  1. #1
    Join Date
    Dec 2007
    Posts
    22

    Have a few quick questions about a program I'm writing

    Ok I have the general idea of what i want in this program, but I just need some help in some areas.

    For one thing I want to make sure in the email textbox that the user must enter text, a "@" and a "." then more text in that perticular order. As it is right now I used an if statement that checks that the characters are both there but does not make sure they are placed in that specific order


    here is a sample of the code i used

    Code:
    private void txtEmail_TextChanged(object sender, EventArgs e)
            {
                //We will use "contains to make sure the user enters
                // "@" and "." in their email address
    
                Email = txtEmail.Text.Trim();
                Email = txtEmail.Text;
                string CheckEmailChar1 = "@";
                string CheckEmailChar2 = ".";
    
                if (Email.Contains(CheckEmailChar1) && Email.Contains(CheckEmailChar2)) 
                {
                  
                }
                
                else
                {
                    MessageBox.Show("Please include @ and . in the email feild");
                }
    
            }

    I am aslo having a aproblem in the "Loan amount requested textbox and I'm not sure exactly why. The program runs but as soon as I input anything into that textbox, I end up with an error and the program stops running.

    I am a bit tired so I hope my post was still somewhat coherent, I will get back to this post later and try and get this fixed fairly soon. You will find the full program in the zip file attached.
    Attached Files Attached Files

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