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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disable X button on MDI form

Status
Not open for further replies.

ctlin

Technical User
Apr 17, 2002
77
US
i know this is an option on child and regular form windows, but it doesn't appear in the MDI window properties. Is there an easy way to disable the top right hand corner X (exit) button? i've seen some pretty complicated solutions involving how the toolbar is drawn...
 
ahh found it:

Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim response As Integer
response = MsgBox("Are you Sure you want to Exit?", vbExclamation + vbYesNo + vbApplicationModal, "Exit")
If response = vbNo Then Cancel = 1

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top