dahall / AeroWizard

Library for easy creation of custom and Aero Wizards. Aero Wizard strictly follows Microsoft guidelines and uses Visual Styles to get visual theming.
MIT License
112 stars 32 forks source link

AcceptButton is always set on the parent form #81

Closed c0shea closed 5 years ago

c0shea commented 5 years ago

In WizardControl.cs you are setting the parent form's AcceptButton property to the nextButton. Under most circumstances this is good, but my problem is I have a multi-line textbox in one of my wizard pages. The user can't press the enter key in the textbox to go to the next line because you've set the AcceptButton to handle the enter key event and advance them to the next page.

As a workaround, I set the AcceptButton property to null in my form's load event. However, I have to hope that the DisplyColorOrCompositionChanged event handler you've defined doesn't fire, otherwise it will set the AcceptButton back to nextButton.

It would be nice if there was a way to disable his behavior.

dahall commented 5 years ago

I actually don't see how this would work as you have then effectively disabled the Next/Finish button from advancing pages and I don't expose that button for reattachment. Can't you simply set the AcceptsReturn property on the TextBox?

c0shea commented 5 years ago

You're right. I hadn't thought about AcceptsReturn. That did what I needed. My workaround was effectively disabling the ability to press enter to advance pages.