Maybe the event handler code for the default button can check which control has focus when Enter was pressed, and behave differently based on the focused control.
Jamal -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Octavian Rasnita Sent: Sunday, October 15, 2006 7:54 AM To: perl-win32-gui-users@lists.sourceforge.net Subject: [perl-win32-gui-users] default button on a form Hi, I have a default button on a form that I want to be pressed when I hit enter on a few controls like textfields and list boxes, but I don't want to be press when hitting enter on a few other list boxes. In the case of those controls, I want to be able to process their onClick event and not press the default button. I have tried not using a default button but using the onKeyUp event on those controls, then searched if the key 13 was released on them and execute the code that I want to be executed at onClick() event. The code works, but with big issues. For example, if a dialog window appears and I hit enter to close it, and the focus goes to one of those controls, I need to release the enter key there and the code is executed again, or if the focus is on one of those controls and I choose a menu item using enter... So that's not a good approach. Is there a better one? Thank you. Teddy ------------------------------------------------------------------------ - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/