CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Location
    Alaska
    Posts
    87

    is there a code for alt-F4?

    is there a code to block alt-F4 please help thanks alot

  2. #2
    Join Date
    Dec 2002
    Location
    NC
    Posts
    125
    Here is a start. This will at least capture it.

    Code:
    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
       If Shift = vbAltMask Then
          Select Case KeyCode
             Case vbKeyF4
                MsgBox "thats it"
          End Select
       End If
       End Sub
    From here you have to figure out how to keep your form or project from closing.

    good luck
    R.L.T.W. A+, NET+, CCNA

    doin' my best

  3. #3
    Join Date
    Apr 2004
    Location
    Alaska
    Posts
    87
    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If Shift = vbAltMask Then
    Select Case KeyCode
    Case vbKeyF4

    End Select
    End If
    End Sub


    Private Sub Form_Load()
    App.TaskVisible = False
    Form2.Show
    End Sub

    Private Sub mnufileclose_Click(Index As Integer)
    Unload Form1
    Unload Form2
    End Sub

    Private Sub Timer1_Timer()
    r = Int((4200 - 5 + 1) * Rnd + 5)
    i = Int((5150 - 10 + 1) * Rnd + 10)
    Form1.Move i, r

    End Sub

    Private Sub Timer2_Timer()
    MsgBox "To close the programm Hit Ctrl + B!!", vbCritical, "HEHE!"
    End Sub
    Last edited by New_Brink; June 13th, 2004 at 11:16 PM.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured