dlg.close();
Closes the dialog, normally you will call this function from within a button callback.
You can find out the values entered by the user using the Dialog.GetValue() function.