Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm Keyboard Control
I am new in Forms design. Can anyone tell me how to activate or specify the
use of Enter and Esc keys in a form so that they represent a positive and a negative user choice? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm Keyboard Control
For the CommandButton that you want "clicked" when the Enter key is
pressed... set its Default property to True. For the CommandButton that you want "clicked" when the Esc key is pressed... set its Cancel property to True. -- Rick (MVP - Excel) "DoctorG" wrote in message ... I am new in Forms design. Can anyone tell me how to activate or specify the use of Enter and Esc keys in a form so that they represent a positive and a negative user choice? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm Keyboard Control
Hi Rick!
Thanks for the feedback. Can you tell me how to trap the red "X" on the top-right corner of the form? Is it the same as the default Cancel key? "Rick Rothstein" wrote: For the CommandButton that you want "clicked" when the Enter key is pressed... set its Default property to True. For the CommandButton that you want "clicked" when the Esc key is pressed... set its Cancel property to True. -- Rick (MVP - Excel) "DoctorG" wrote in message ... I am new in Forms design. Can anyone tell me how to activate or specify the use of Enter and Esc keys in a form so that they represent a positive and a negative user choice? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm Keyboard Control
You would "trap" the red X by using, depending on your needs, either the
QueryClose or Terminate event procedures for the UserForm (in the UserForm's code window, select UserForm from the left-hand drop down and QueryClose or Terminate from the right-hand drop down). The QueryClose event gives you the ability to cancel the closing of the UserForm if desired via its Cancel argument. -- Rick (MVP - Excel) "DoctorG" wrote in message ... Hi Rick! Thanks for the feedback. Can you tell me how to trap the red "X" on the top-right corner of the form? Is it the same as the default Cancel key? "Rick Rothstein" wrote: For the CommandButton that you want "clicked" when the Enter key is pressed... set its Default property to True. For the CommandButton that you want "clicked" when the Esc key is pressed... set its Cancel property to True. -- Rick (MVP - Excel) "DoctorG" wrote in message ... I am new in Forms design. Can anyone tell me how to activate or specify the use of Enter and Esc keys in a form so that they represent a positive and a negative user choice? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting control on userform with part of control name (set question) | Excel Programming | |||
How do I reset my Control+A keyboard shortcut in Excel? | Excel Discussion (Misc queries) | |||
Passing scrollbar control to keyboard arrow keys | Excel Programming | |||
Hide UserForm with Keyboard? | Excel Programming | |||
Why is pointer and keyboard control is lost in certain Excel file. | Excel Discussion (Misc queries) |