how to prevent using ALT F4 TO close a vb form

The Alt+F4 can be disabled by setting the KeyPreview of the Form to true and adding a KeyDown event handler

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        If e.KeyCode = Keys.F4 And e.Modifiers = Keys.Alt Then
            e.Handled = True
        End If
    End Sub