From: David Youngblood on

"MikeD" <nobody(a)nowhere.edu> wrotel...
>
>
> "Karl E. Peterson" <karl(a)exmvps.org> wrotegbl...
>> Jeff Johnson wrote:
>>> "MikeD" <nobody(a)nowhere.edu> wrotel...
>>>
>>>>> I personally feel that the hidden button with Cancel = True is cheesy,
>>>>> cheesy, cheesy. Use KeyPreview, plain and simple.
>>>>
>>>> Why?!?
>>>
>>> Mind you I'm talking about the "hidden" cancel button scenario, where
>>> you put a button on the form but make it permanently invisible by making
>>> its coordinates -1000, -1000 or something like that and its only purpose
>>> for existing to to trap the Esc key. If the app was going to have a
>>> Cancel Changes button in plain view of the users then setting Cancel =
>>> True on that button makes perfect sense.
>>
>> I think that's the gut-check issue, on the "hidden" button, here.
>> Creating a window for something another already existing window can
>> already do quite easily with just a little bit of code. Just isn't
>> right.
>>
>
>
> Perhaps I'm looking at it a different way than you 2 are. Now, I think
> you're both saying to use the form's KeyPreview and write code to handle
> the Esc key in that. That's fine and dandy. BUT...the code in the form's
> KeyPress event is going to fire an awful lot (with every keypress the user
> makes while the form is active). Using a command button which is way off
> of the form eliminates the needless execution of that code over and over.
> I see nothing cheesy about it if the purpose is to execute code solely
> when Esc is pressed regardless of what control has focus.

Setting TabStop to False doesn't guarantee that the off screen button won't
get focus. Control navigation (for some controls) can also be done via the
arrow keys.

David


From: MikeD on


"David Youngblood" <dwy(a)flash.net> wrote in message
news:OQrf0bS0KHA.4548(a)TK2MSFTNGP06.phx.gbl...

>
> Setting TabStop to False doesn't guarantee that the off screen button
> won't get focus. Control navigation (for some controls) can also be done
> via the arrow keys.
>

Never been a reported issue. <g>

But to my knowledge, arrows keys are only used for navigation within a
"group" (such as option buttons within their container). Otherwise, it's the
Tab key to move from control to control.

--
Mike



From: Karl E. Peterson on
MikeD wrote:
> "David Youngblood" <dwy(a)flash.net> wrote...
>> Setting TabStop to False doesn't guarantee that the off screen button won't
>> get focus. Control navigation (for some controls) can also be done via the
>> arrow keys.
>
> Never been a reported issue. <g>
>
> But to my knowledge, arrows keys are only used for navigation within a
> "group" (such as option buttons within their container). Otherwise, it's the
> Tab key to move from control to control.

That's my experience, too. I suppose you could always toss in another
chunk of cheese by doing a SendKeys("{Tab}") in the GotFocus, though?
<gd&r>

--
..NET: It's About Trust!
http://vfred.mvps.org


From: Daryl Muellenberg on

"Jeff Johnson" <i.get(a)enough.spam> wrote in message
news:u4NXQ1P0KHA.3624(a)TK2MSFTNGP05.phx.gbl...
> "Daryl Muellenberg" <dmuellenberg(a)comcast.net> wrote in message
> news:45D53973-4270-48F4-A29E-0C453961A6A4(a)microsoft.com...
>
>>>> This is not a good idea if your app is designed for general (not
>>>> personal) use. The Cancel button is standard and the user knows the
>>>> purpose of the button. Without the button on the screen, how does the
>>>> user know that the Esc key cancels his/her changes?
>>>
>>> There are lots of applications where Esc is used in this way. Off the
>>> top of my head: Access.
>>>
>> I'm not saying that you shouldn't use the Esc key to cancel changes, just
>> that there should be some other visual graphic to perform the cancel
>> operation. I don't have Access installed so I can't verify right now, but
>> I do have Excel and Esc will also cancel changes in Excel but there is
>> also an 'X' button on the toolbar that the user can press to perform the
>> cancel, so I assume that Access does the same thing.
>
> No, it doesn't. There is no visual indicator in Access (at least up to
> 2003) for "cancel changes to field/record."

Isn't there an Undo/Cancel button on the toolbar (the button with an arrow
bending backwards)?

From: Jeff Johnson on
"Daryl Muellenberg" <dmuellenberg(a)comcast.net> wrote in message
news:CA4E8325-65F9-4410-9F31-D19AA0AC36D4(a)microsoft.com...

>> No, it doesn't. There is no visual indicator in Access (at least up to
>> 2003) for "cancel changes to field/record."
>
> Isn't there an Undo/Cancel button on the toolbar (the button with an arrow
> bending backwards)?

Yes, although it's simply called Undo. I never knew it could be used that
way. I don't mentally associate Undo and Cancel. Undo is something that
happens after something has been "done." Cancel happens before something
gets "done." At least to me. So while there apparently IS a visual
indicator, I don't think it's a very good one!