I don't know if this is possible in MS. I have a simple dialog box just one field is in it, when the user enters the data they have to click on tab to go to the "OK" button for the script to continue. I have been asked to remove the need for hitting the tab key first.
So they would enter 123 and press Enter instead of entering 123 tab enter.
Also is there a way without the mouse move command for the cursor to be in a given edit box. In other words the user currently clicks on an icon to run the script, then they have to move their mouse into the edit box and then enter the data. It would be nice if when the dialog opened it had the cursor in the edit box already.
Press Enter instead of tab and enter
Moderators: JRL, Dorian (MJT support)
Kpass,
JRL gave me a nice work around some time ago.. see if this helps..
Ed
http://www.mjtnet.com/usergroup/viewtop ... highlight=
JRL gave me a nice work around some time ago.. see if this helps..
Ed
http://www.mjtnet.com/usergroup/viewtop ... highlight=
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
I answered a similar question a few days ago. See my reply here:
http://www.mjtnet.com/forum/viewtopic.php?p=20171
You can put the keyboard focus (and therefore the cursor) in any dialog field like this:
LibFunc>user32,SetFocus,r,DIALOG1.MSEDIT2.HANDLE
http://www.mjtnet.com/forum/viewtopic.php?p=20171
You can put the keyboard focus (and therefore the cursor) in any dialog field like this:
LibFunc>user32,SetFocus,r,DIALOG1.MSEDIT2.HANDLE
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
If you only have one edit box and one button this becomes very simple to accommodate. The order of the objects in the dialog block determines the order of their focus as you tab through the dialog. In other words if you want the edit box to have focus when the dialog is opened, make the edit box the first object defined in the dialog block.kpassaur wrote:I have a simple dialog box just one field is in it....is there a way without the mouse move command for the cursor to be in a given edit box.
There is a "Default" feature in dialogs that allows you to set a button to be the default when enter is pressed and while focus is on an edit field.kpassaur wrote:...when the user enters the data they have to click on tab to go to the "OK" button for the script to continue. I have been asked to remove the need for hitting the tab key first.
Code: Select all
Dialog>Dialog1
Caption=Demo
Width=230
Height=110
Top=160
Left=48
//Edit box is first object defined and will take focus
//when the dialog opens
Edit=msEdit1,48,16,121,
Button=Ok,72,48,75,25,3
//Default states that pressing the Enter key will "press" the
//Ok button without first tabbing to it.
Default=Ok
EndDialog>Dialog1
Show>dialog1,res1
Default button and focus also works on drop downs
Thank you all it works great by putting them in order (each of these has only one box) and adding the line Default="Button Name". I have found that if instead of an edit box there is a drop down list they can use the down arrows and press enter.