Re: The enter key compared to tab in Windows Development


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Brian Levantine on February 20, 2004 at 09:33:19:

In Reply to: The enter key compared to tab in Windows Development posted by Greg Estes on Tue, 17 Feb 2004 15:44:09 :

Hi Greg. The process of using the Enter key to accept data on a field-by-field basis is a little complicated. You must create a pushbutton that will represent the "default" pushbutton. The "default" pushbutton will send a BN.CLICK message when the user presses Enter. There are a couple issues you must deal with to make this work: First, you probably don't want to see this button so you must hide it (the program direct.ibs does this). Second, whenever a user moves the focus to a button on a dialog, that button becomes the new default so you must ensure that your new button is always set back to be the default. You can do this by setting the style whenever a user enters a field. The next problem you will face is that when the BN.CLICK message is sent, you need know which field the user was in when Enter was pressed so you can retrieve the data. This can be done by keeping track of each field as you enter it. Lastly, because the focus is now on the hidden button, you'll need to explicitly set the focus to the next desired control. I hope this helps.



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):






[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]