Enable ESC to canel UserForm
Thanks Squirrel and James -
I keep forgetting how to re-select hidden controls; thanks for the reminder
Squirrel. And, if I put the cancel button behind each page of the multipage,
it works fine.
It just seems like you should be able to drop one button in behind the whole
multipage especially when there is no need for the user to see it. I'll use
your suggestion James and slide a very narrow button in below the multipage
so it just looks like a line.
Thanks for the help !
--
Jay
"Jay" wrote:
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
|