AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Enter as Tab for GUI entering

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
jchristl
Guest





PostPosted: Thu Apr 21, 2005 7:41 pm    Post subject: Enter as Tab for GUI entering Reply with quote

This is a simple question. I'm creating a GUI that contains several variables. They're all numbers. Is there a way to cause the Enter key to act as a Tab, so the cursor will move to the next field?

Thanks
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Thu Apr 21, 2005 10:56 pm    Post subject: Reply with quote

A really basic solution is to use the default button to send a tab keystroke. The following example seems to work okay:
Code:
gui, add, edit
gui, add, edit
gui, add, edit
gui, add, checkbox,, Sample checkbox
gui, add, DropDownList
gui, add, slider
gui, add, button, default, Next
gui, show
return

ButtonNext:
Send {tab}
return

GuiClose:
ExitApp


Alternatively, if this script will run only on Windows NT/2k/XP or later, the following script in which ~Enter is a hotkey also seems to work:
Code:
gui, add, edit
gui, add, edit
gui, add, edit
gui, add, checkbox,, Sample checkbox
gui, add, DropDownList
gui, add, slider
gui, add, button,, &OK
gui, show
return

ButtonOK:
GuiClose:
ExitApp

~Enter::
Gui +LastFound
IfWinNotActive
   return
GuiControlGet, FocusedControl, Focus
if FocusedControl <> Button2
   Send {tab}
return
Back to top
View user's profile Send private message Send e-mail
jchristl
Guest





PostPosted: Fri Apr 22, 2005 12:20 pm    Post subject: Reply with quote

That first one works. But is there a way to hide the 'Next' button?

Thanks
Joe
Back to top
jchristl
Guest





PostPosted: Fri Apr 22, 2005 1:36 pm    Post subject: Reply with quote

Never mind. I added
Code:
GuiControl, Hide, Next
below the button.

Thanks
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group