Textbox input validation

Discussion in 'C#' started by whirlwind, Apr 29, 2009.

  1. whirlwind

    whirlwind New Member

    Joined:
    Apr 12, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Hello all,

    I have wrote a small exercise program with 4 text boxes which required user to input y or n

    Could someone kindly show me how to do a simple input validation so only y or n are valid responses

    Thank you so much
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    3
    Trophy Points:
    0
    if ( x == 'y' || x == 'n' || x == 'Y' || x == 'N' )
     
  3. chunduri.babyrani

    chunduri.babyrani New Member

    Joined:
    Jun 15, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    I am new to the C# programming... I am doing one project on WinForms... Based on that knowledge i am suggesting u to try the below code once..
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice