【WPF】TextBox汇总
一、隐藏边框
<TextBox Text="Hello" Width="480" TextWrapping="Wrap" IsReadOnly="True" BorderBrush="{x:Null}" BorderThickness="0"></TextBox>
关键语句 BorderBrush="{x:Null}" BorderThickness="0"
二、使用KeyBinding绑定命令、键盘事件
eg:回车事件
<TextBox Text="{Binding CurrentPage}" > <TextBox.InputBindings> <KeyBinding Command="{Binding GotoPageCommand}" Key="Return"/> </TextBox.InputBindings> </TextBox>
参考1:https://blog.csdn.net/BYH371256/article/details/122506104
参考2:https://blog.csdn.net/BadAyase/article/details/125308737
/*******相与枕藉乎舟中,不知东方之既白*******/