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

Disable Close on Max form

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi Everyone

I know this question has been asked before but can anyone tell me how to disable the Close button on a maximized form.

I have tried a number of pieces of code but they have not worked.

Many thanks
tee
 
Hi tee!

Declare a form level boolean variable bolClose. In the form load event set the variable to true. In the command button that I assume you have created to allow the user to close the form set the variable to false. In the form's unload event put this code:

Cancel = bolClose

Now the form will not close unless they use your button.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top