I have a Dialog Box which loads with many, many check boxes and user input fields. I use the mouse to move around and make my changes to checkbox settings and to go to user input fields. (Dialog box input gathers variables for graphing routine).
Is there some way to have a default focus set to the OKAY button so that whenever I hit Enter on the keyboard the dialog would do what the OKAY Button is set to (and process the dialog box)?
Thanks
Dave
Default Focus in Dialog Box?
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
It sounds like you just want to close the Dialog box and continue the script using the values from the dialog box. You want to do this using the Enter key on the keyboard, vs. using the mouse to click on OKAY button?Is there some way to have a default focus set to the OKAY button so that whenever I hit Enter on the keyboard the dialog would do what the OKAY Button is set to (and process the dialog box)?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Bob has got what I want to do correct. If I
1. move the mouse over the OKAY button / Click
OR
2. if I hit ENTER on the Keyboard
-- I want to close the dialog box and continue my script.
Lumumba's approach saves me having to click but doesn't handle the Enter via keyboard.
any ideas on how to do this?
Thanks
Dave
1. move the mouse over the OKAY button / Click
OR
2. if I hit ENTER on the Keyboard
-- I want to close the dialog box and continue my script.
Lumumba's approach saves me having to click but doesn't handle the Enter via keyboard.
any ideas on how to do this?
Thanks
Dave
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Three quick untested thoughts:
1. I haven't tried this, and it is not conventional layout, but have you tried putting the OKAY button as the first object on the Dialog? If the cursor normally goes to the first object, then pressing ENTER may activate the button. Of course this would have to then use all the default values of the combo boxes, text fields, etc.
2. But if putting the OKAY button near bottom. why can't you just press the Tab key until OKAY is active, then press ENTER?
3. Will CTL-END go to the last object on the Dialog? If yes, then make the last object the OKAY button. From anywhere in the dialog, press CTL-END, ENTER.
1. I haven't tried this, and it is not conventional layout, but have you tried putting the OKAY button as the first object on the Dialog? If the cursor normally goes to the first object, then pressing ENTER may activate the button. Of course this would have to then use all the default values of the combo boxes, text fields, etc.
2. But if putting the OKAY button near bottom. why can't you just press the Tab key until OKAY is active, then press ENTER?
3. Will CTL-END go to the last object on the Dialog? If yes, then make the last object the OKAY button. From anywhere in the dialog, press CTL-END, ENTER.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
I will play with idea one. The whole point of the enter key is that I often change one input and hit enter without even having to look at the keyboard. If I have to think about clicking tab the right number of times then enter it defeats the purpose This is not a disability related problem - I am just lazy !
The Ctrl-End didn't do anything.
I was hoping that there would be some (maybe undocumented) focus property like the controls in Visual Basic for Applications (excel macros - my only other real programming).
I will play around and let you know.
Thanks for the reply.
Dave
The Ctrl-End didn't do anything.
I was hoping that there would be some (maybe undocumented) focus property like the controls in Visual Basic for Applications (excel macros - my only other real programming).
I will play around and let you know.
Thanks for the reply.
Dave
Back to the drawing board!
The placement of the Okay button as the first object allowed the focus to be initially set on it but as soon as I changed any of the other 50 checkbox / user input objects the focus then was set there and ENTER does nothing.
I am guessing that, without a formal focus property (Hint: Marcus) I will fail on this improvement.
I just had a thought - is there a way to set a variable that captures all user input so that "Ctrl F12" or "ENTER" could be identified from keystrokes? It would have to active while the dialog box is on the screen (I am guessing that it would work easier if it was in a regular script - just test on each Input> occurrence). This might work for my project.
Until later,
Dave
P.S. - I haven't been getting email notification of replies on this thread. Anybody else noticed that in the last 24 hours or is it my ISP at fault?
The placement of the Okay button as the first object allowed the focus to be initially set on it but as soon as I changed any of the other 50 checkbox / user input objects the focus then was set there and ENTER does nothing.
I am guessing that, without a formal focus property (Hint: Marcus) I will fail on this improvement.
I just had a thought - is there a way to set a variable that captures all user input so that "Ctrl F12" or "ENTER" could be identified from keystrokes? It would have to active while the dialog box is on the screen (I am guessing that it would work easier if it was in a regular script - just test on each Input> occurrence). This might work for my project.
Until later,
Dave
P.S. - I haven't been getting email notification of replies on this thread. Anybody else noticed that in the last 24 hours or is it my ISP at fault?
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact: