locked
find text in Textbox RRS feed

  • Question

  • I want to make a app that plays a sound if you type something in the Textbox

    example: when you type, helloworld. but I want my app to play the sound also when you type , bhsdhfjsdfhelloworld , or , helloworld dsfsf, or dfsdfgdsghelloworld sdfsdf  :D

    so my question is, what code can I use for this?

    can I do this with Textbox or with string or both?

    Wednesday, September 1, 2010 1:40 PM

Answers

  • if ( textbox.Text.Contains("helloworld") )
     soundPlayer.Play();
    
    • Proposed as answer by Mitja Bonca Wednesday, September 1, 2010 2:59 PM
    • Marked as answer by Alan_chenModerator Friday, September 3, 2010 6:55 AM
    Wednesday, September 1, 2010 2:43 PM