Re: Capture F5 Keystroke

From: BruSoft (bruce_at_bru-soft.com)
Date: 11/26/03


Date: Tue, 25 Nov 2003 19:19:03 -0800

Donlad wrote:

>Can some help figure out how to capture if F5 is pressed.
>
>
    Key is passed to the OnKeyUp, OnKeyDown, etc. events. Check if Key
= VK_F5

>
>secondly when the users closes the app clicking the x in the top right, how
>do I show a message box asking are you sure. I can display the message box,
>but not sure how to cancel the terminate.
>
>
    In the OnCloseQuery event on the form put your message box and if
you want to cancel the close, set the CanClose parameter sent into the
event to False.

>
>Thanks
>
>Donald
>
>
>
>

-- 
Bruce Michener http://www.bru-soft.com


Relevant Pages

  • Re: Capture F5 Keystroke
    ... > Donlad wrote: ... > Key is passed to the OnKeyUp, OnKeyDown, etc. events. ... >>but not sure how to cancel the terminate. ...
    (borland.public.delphi.language.objectpascal)
  • Re: Batch file and MFC (Properly Terminating Application)
    ... running any secondary modal loop. ... don't write an OnCancel handler, ... the changes the user thought had been made--because the app closed without ... user clicks on Cancel button and application exits. ...
    (microsoft.public.vc.mfc)
  • Re: Change the way x closes a form
    ... FormB ). ... contradiction in terms, as infact they'd want to Cancel, not Confirm. ... If you wan't the app to close, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Windows wont shut down
    ... app cancels the request to shut down, then it will halt the shutdown. ... > restart, windows shuts down fine. ... > click changes the DialogResult from None to Cancel. ...
    (microsoft.public.dotnet.languages.csharp)
  • Capture Excel close
    ... Public WithEvents App As Application ... Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As ...
    (microsoft.public.excel.programming)