You can completely hide the close button on the control panel by setting the form's ControlBox property to False.
Or one way that I've disabled it is to have a boolean variable that I set initially to False. Then every time the form is closed by a button of my own I set it to True. That way, if the user clicks the close button and my variable is still False, I know they used the close button in the control box. Then all you have to do is add code to the FormClosing Event to cancel the event if the variable is still false.
Here is some sample code where I do something similar. I am disabling the close button when the user is synchronizing the application which is tracked by a variable called boolIsSyncRunning:
Private Sub Update_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If boolIsSyncRunning Then
My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Beep)
e.Cancel = True
End If
End Sub
Hope this helps.