Implemented code

also set the Accept button and Cancel button of the form