Вам понадобится переменная:
Private okToClose As Boolean = False
Установите ее, когда пользователь нажимает кнопку Закрыть:
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
okToClose = True
Me.Close()
End Sub
Затем проверьте значение:
Protected Overrides Sub OnFormClosing(e As FormClosingEventArgs)
If Not okToClose Then
MessageBox.Show("Cierra Usando el boton SALIR", "Atención",
MessageBoxButtons.OK, MessageBoxIcon.Error)
e.Cancel = True
MyBase.OnFormClosing(e)
End If
End Sub