| View previous topic :: View next topic |
| Author |
Message |
JohnSawyer Newbie
Joined: 25 Feb 2003 Posts: 8 Location: San Diego, CA
|
Posted: Thu Mar 13, 2003 7:26 pm Post subject: Dialog edit field question/problem |
|
|
I have a dialog setup with several edit controls and 2 buttons (ok/cancel). I want to have the user fill out the fields and hit <enter> so they don't have to use their mouse, or change the focus to the OK button. How do I do this?
John Sawyer
VDS Noob. |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Mar 13, 2003 7:33 pm Post subject: |
|
|
Add the DEFAULT style when you create the OK (or whatever) button:
DIALOG ADD,BUTTON,OK,5,5,50,25,,,DEFAULT
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Fri Mar 14, 2003 10:28 pm Post subject: |
|
|
thanks for that mac...i can now use this in one of my programs...have been wondering how to do it
Serge _________________
|
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Mar 14, 2003 10:57 pm Post subject: |
|
|
Glad to help out Serge.
Another thing I have done to use the ENTER key on multiple
edit boxes (with the EXIT style as needed), is add a dummy
ENTER button like this:
| Code: |
DIALOG ADD,BUTTON,Enter,0,0,0,0,,,DEFAULT
|
Then under the EnterBUTTON label:
| Code: |
:EnterBUTTON
rem -- "%%hwnd" is the window identifier --
WINDOW SEND, %%hwnd, @tab()
rem -- catch any EXIT events --
%e = @event()
if %e
goto %e
end
goto EVLOOP
|
This allows ya to just keep hitting the ENTER key, and when
ya get all the data entered, the last EDIT box "EXIT" event
allows ya to save it (or whatever).
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Fri Mar 14, 2003 11:07 pm Post subject: |
|
|
thanks again mac...now i understand the use to EXIT...i had read about it but didn't quite understand it...i can now add that to it too!
thanks once again
Serge _________________
|
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Fri Mar 14, 2003 11:54 pm Post subject: |
|
|
Cool, Mac. Been wondering how to do that  _________________
 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|