Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect close button or get rid of it totaly?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Anyone know how to detect the close button or better yet, get rid of it totaly.That little
red X button on the upper right corner on a form?
 
Try setting the form property ControlBox to false

Best Regards
Almi
 
thanks a-Million! All this time it was under my nose, how did I not see it:)
 
You could also check the event "OnClosing" which will happen if you try to close the form in any way.

I use it to see if I need to close just the form ot the whole program.

Protected Overrides Sub OnClosing(ByVal e As System.ComponentModel.CancelEventArgs)
UBP1.gsFrmNum -= 1
CloseScreenMaybeApp()
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top