i have tabbed windows forms application , if user close any tab i ask him
if he he need to save data or not , giving him option yes , no , cancel
i managed that situation by inherting from form that handel onclousing method , but if the user press the button new , it will show data in the same form , so the form is not closed although there is data must saved first , also if user press next or previous , alse if user is using search
and a new object is shown without saving the prevois , so i think of creating attribute for methods like "NewButton_Click" that attribute check if there are data unsaved or not in the form (i can get that form by parentform (activeform) )so it will show messege that ask if user need to save or not , if saving i will call save that is ovverrided in that active form