Add tabpage closing event and close event.