Disabling the standard function keys

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Niels Borg

    Disabling the standard function keys

    Hi,
    I am building an app, where I would like to disable the standard windows
    function keys. I.E. F4 which expands a a selected drop-down list.

    Can anyone help me on that?

    Many thanks

    Niels Borg


  • Stephane Richard

    #2
    Re: Disabling the standard function keys

    I would say do the following.

    Set your form's Keypreview property to True.

    In the form's Keydown event Add the following code

    ' add all keys here you want to block to this if statement with Or
    If KeyCode = vbKeyF4 or KeyCode = vbKeyF5 Then
    KeyCode = 0
    Endif

    this should Block it for you pretty good, however if you want a bit more
    control than that, you can add the same code to the keydown even of the
    controls themselves instead of in the form's code.

    Stéphane Richard
    Senior Software and Technology Supervisor

    For all your hosting and related needs


    "Niels Borg" <nbborg@hotmail .com> wrote in message
    news:3f129df1$0 $32476$edfadb0f @dread16.news.t ele.dk...[color=blue]
    > Hi,
    > I am building an app, where I would like to disable the standard windows
    > function keys. I.E. F4 which expands a a selected drop-down list.
    >
    > Can anyone help me on that?
    >
    > Many thanks
    >
    > Niels Borg
    >
    >[/color]


    Comment

    Working...