简体   繁体   中英

TextBox Changed event

Instead of immediately calling function when text box is changed. I want to wait until a certain word is entered from a string. However the code I have written does not seem to work. Can anyone inform me f the correct approach to this.

private void txtConsole_TextChanged(object sender, EventArgs e)
    {
        string FastModeTest = "";
        if (FastModeTest.IndexOf("ADR=") > -1)
        {
            TestRoutine2();
        }
    }
private void txtConsole_TextChanged(object sender, EventArgs e)
{
     if (txtConsole.Text != "SOMEWORD")
        return;

    // rest
}

this code will cancel this function if certain key is not entered.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM