Home > Back-end > Delphi7 small white the great god, genuflect is begged window closing remind save problem
Delphi7 small white the great god, genuflect is begged window closing remind save problem
Time:11-10
Form a stringgrid forms, remind save data before closing, Now I set up a global variable record is saved, true is saved, false unsaved Force true form creation time variable is initialized, did not press the save button before all of the operation is set to false, press the save button Back to true, Here's the thing, if after add delete content did not change after modification and so on a series of operations, but the variable Also marked as false, a great god help!!!!!! More than just registered, only 50 points, inclusion
CodePudding user response:
//in the OnClose event execute the following code: Procedure TForm1. FormClose (Sender: TObject; Var Action: TCloseAction); The begin If IsModified then//IsModified's global variables you said The begin Action:=caNone; ShowMessage (' data has been modified, please save the data). end; end;