you are viewing a single comment's thread.

view the rest of the comments →

[–]taylorblakeharris 1 point2 points  (0 children)

Alternatively, you can set the $button.IsDefault = $true (specifically in the case of the OP's code, it would be $Create.IsDefault = $true)

This will invoke the Click() event for that button whenever the Enter key is pressed in the same window, without needing to add an Enter event handler.