I have a form with a progress bar and a cancel button which is displayed as a process runs. The buttons "Cancel" property is set to true so pressing escape, cancels the process.
But, as the button is the only control on the form capable of taking the focus, should the user inadvertently press enter (or space bar) while the process is running it will be cancelled.
I have prevented the Space Bar from working by setting KeyPreview to true (on the form) then setting KeyAscii to 0 but this approach deson't seem to work for the enter key as the button click event fires first.
I've tried setting the button's TabStop property to "false" - no change.