<TextBox >
<TextBox.InputBindings>
<!--键盘事件绑定-->
<KeyBinding Command="{Binding KeyBindClick}" Key="Enter"/>
<!--鼠标事件绑定-->
<MouseBinding Command="{Binding MouseClick}" MouseAction="LeftDoubleClick"/>
</TextBox.InputBindings>
</TextBox>
WPF学习小记-文本框按回车触发Command
于 2024-04-10 14:09:26 首次发布