February 10, 200619 yr How can I implement a default button (one that is automatically selected by hitting the Enter button) in a custom window? In other words I have designed a custom window with several buttons and would like to close the window by simply hitting the Enter button rather than using the mouse to click on the "Close Window" button.
February 10, 200619 yr You want to close the window simply by hitting ENTER but the window is nothing but buttons? If User has their hand on the mouse anyway, a click (whether on a button or X) seems simpler than reaching up to hit the ENTER. Well, in vs. 8, you can tab to (and activate) a button. You can also use an event-trigger plugin. Or you might be able to take advantage of Find Mode[] which will activate upon ENTER (as I've seen Comment do). But, if the only thing on the window is buttons, it seems simpler to have each button end with a sub-script of Close Window[] after it does its thing... You can also ignore the window and let it disappear behind and/or close it at your leisure or let it remain in the background to be brought forward again when needed. How often will this window be called? If there are no fields on this window layout then you won't be dealing with record-locking issues if you choose to leave it open. Does the User enter data into fields in this window also? If we understood more of your process and purpose here, we might have better suggestions. LaRetta
February 10, 200619 yr Author Thanks for the quick response. The custom window which opens when the user clicks on a Line Item from the main Invoices window contains additional input fields as well as several custom buttons. One of the buttons is always the "Close" button which closes the window enabling the user to return to the main Invoices window. At the moment you need to mouse click on the "Close" button, but I was wondering how I could achieve the same action by simply pressing the Enter button (similar to how a dialog window works with a default button).
February 10, 200619 yr You could make your script open the new window and pause. When you have a paused script, hitting the Enter button will resume it, so the next step after the pause should be to close the window. The 'Close Window' button should be set to Resume script.
Create an account or sign in to comment