Building a application in winforms with alot of pure powershell functions inside its code. As for now around 6k lines. And i wanted to make the login-logic a more modern touch so i changed the default
$loginButton = New-Object System.Windows.Forms.Button
$form.AcceptButton = $loginButton
to instead use
$loginButton = New-Object Windows.Forms.Panel
$form.Controls.Add($loginButton)
But with this new object, i cant find any information on how to make it accept "ENTER" key as before. Atleast not without having to add my whole code-logic again inside a button press with alot of events inside. And that breaks my whole application...
.AcceptButton; presumably, it is fine for such a button to be contained inside a panel.0, also the Down and Hover colors. Add an image if that gives it a more modern touch