c# - WPF: Validate TextBox content immediately -


this question has answer here:

is there way in wpf/xaml indicate validation should performed (after each character entered in textbox) instead of when focus lost?

you should detect event "keyup" or "keydown" , check if input correct.

private void textbox_keyup(object sender, keyroutedeventargs e) {             if (e.key == yourkey)     {         //do     } } 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -