Results 1 to 2 of 2

Thread: VS 2010 Keyboard disable.

  1. #1
    New Member
    Join Date
    Jul 12
    Posts
    4

    VS 2010 Keyboard disable.

    Hello,
    I got my splash screen policy to work. I am not looking for a code that will disable keyboard and just have mouse enabled when the policy is on the screen.
    My current code is:

    Public Class Form1


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)

    Button1.Enabled = False
    Button2.Enabled = False


    End Sub


    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged

    If CheckBox1.Checked Then
    Button1.Enabled = True
    Button2.Enabled = True
    Else
    Button1.Enabled = False
    Button2.Enabled = False

    End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Me.Close()
    Form2.Close()

    End Sub


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    Me.Close()
    Form2.Close()
    Shell("Shutdown -f -r -t 120")



    End Sub


    End Class



    Thank you

  2. #2
    PowerPoster
    Join Date
    Feb 12
    Location
    West Virginia
    Posts
    4,978

    Re: VS 2010 Keyboard disable.

    Well in theory you could set the keypreview for the form to true then in the form keypress event you could try e.handled=true

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •