prevent form from closing
Visual Basic
1
Posts
1
Posters
0
Views
1
Watching
-
im wondering how you can setup a form so it cannot be closed? i am trying to have a form so that the only way to get rid of it is to press a button on the form, which will only .hide() it. and another button on different form will .show() it, restoring all of it's window settings, etc. this is including when the user presses alt+f4 or hits the X (close) button, to hide rather than close the form. ... i was just reading up on it, and it seems to work like this:
Private Sub BrowserForm_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing e.Cancel() = True Me.Hide() End Sub
this the proper way to do this? thanks for any input. ------------------------ Jordan. III