Capture Enter Key

Stimulsoft Reports.NET discussion
Post Reply
mmurdock
Posts: 94
Joined: Tue Mar 20, 2007 4:59 pm

Capture Enter Key

Post by mmurdock »

I use forms to allow users to enter in filters for a report. When the user clicks on my OK button it then runs the report. I would like to have so that if a user presses there Enter key it will act as if the OK button was pressed. Right now if they press Enter it runs my report but does not run my script that is tied to the OK button. I have set the ok button to be the default button. I think it only ignores this when a textbox has focus. Any help with this would be appreciated.

Mat
Brendan
Posts: 309
Joined: Sun Jul 16, 2006 12:42 pm
Location: Ireland

Capture Enter Key

Post by Brendan »

I set my "OK" buttons to [Default = True, Cancel = False, DialogResult = OK] and "Cancel" button to [Default = False, Cancel = True, DialogResult = Cancel]
But you say you've already set Default to true? Maybe there's two buttons with default set to true?
mmurdock
Posts: 94
Joined: Tue Mar 20, 2007 4:59 pm

Capture Enter Key

Post by mmurdock »

I have it set exactly as you have yours. It seems to ignore the Default=true when your cursor is in a text box.

Mat
Brendan
Posts: 309
Joined: Sun Jul 16, 2006 12:42 pm
Location: Ireland

Capture Enter Key

Post by Brendan »

It's not a multi line textbox no?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Capture Enter Key

Post by Edward »

We've found the following inaccuracy:

When you press the "Enter" key, the Text property of the TextBox component remains unchanged and the Click event Handler is called with its previous value. We will correct this value in the next prerelease build.

But "Click" Event Handler for "OK" button is always called.

Thank you.
mmurdock
Posts: 94
Joined: Tue Mar 20, 2007 4:59 pm

Capture Enter Key

Post by mmurdock »

I have the text box set to not accept returns and it is not a multiline box either.

Thanks for looking into this.

Mat
Post Reply