View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Enable ESC to canel UserForm

I'd like to enable the Escape key to cancel a userform. My form has a single
multipage control with two pages.

I have inserted a commandbutton with its Cancel property set to True and
have hidden the commandbutton by sending it behind the Multipage control.
Its Click event is:

Private Sub CommandButton1_Click()
Unload Me
Set frmInstructions = Nothing
End Sub

I encounter two problems with this: First, the Escape key unloads the form
only when the second page of the multipage is visible (I'd like Esc to cancel
the form at any point). Second, I can't select the button for editing after
it is hidden behind the multipage (need definitive selection method).

--
Thanks in Advance,
Jay