1. Code behind.
复制代码
1
2
3
4protected void TextBox1_TextChanged(object sender, EventArgs e) { Label1.Text = Server.HtmlEncode(TextBox1.Text); }
2. Event trigger
复制代码
1xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
复制代码
1
2
3
4
5<i:Interaction.Triggers> <i:EventTrigger EventName="TextChanged"> <i:InvokeCommandAction Command="{Binding StartTextChanged}" /> </i:EventTrigger> </i:Interaction.Triggers>
3. MVVM ( Prefered)
复制代码
1<TextBox Text="{Binding MyText,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
转载于:https://www.cnblogs.com/fdyang/p/10160503.html
最后
以上就是高兴书本最近收集整理的关于(WPF) Textbox 每次输入触发事件处理的全部内容,更多相关(WPF)内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复