I think ur Dialog closes. because the Dialog's close button has AutoDefault property set to true.