Nulla di pratico, è solo un esercizio teorico per studiare l' uso di e.SuppressKeyPress.

Praticamente voglio bloccare la pressione del tasto LWin (quello che equivale a premere Start) quando il mio Form è attivo.

Ho messo ovviamente la proprietà KeyPreview del form a True.

codice:
    Private Sub Frm1_KeyDown(sender As Object, _
        e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown

        Debug.Print("In down: " & e.KeyCode.ToString)
        If e.KeyCode = Keys.LWin Then
            Debug.Print("Ok, suppress down")
            e.SuppressKeyPress = True
        End If

    End Sub

    Private Sub Frm1_KeyUp(sender As Object, _
        e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp

        Debug.Print("In Up: " & e.KeyCode.ToString)
        If e.KeyCode = Keys.LWin Then
            Debug.Print("Ok, suppress up")
            e.SuppressKeyPress = True
        End If

      End Sub
Risultato:

In down: LWin
Ok, suppress down
In Up: LWin
Ok, suppress up
...................... ed il tasto Start viene tranquillamente premuto ....

Dove è l' errore teorico??


Ty