The Form class of windows forms has the AcceptButton property, which allows certain button to be clicked when a user press Enter. Does the Window class of WPF has similar feature?

有帮助吗?

解决方案

It's the IsDefault property on the Button:

<Button IsDefault="true">OK</Button>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top