private void btnEnlist_Click(object sender, EventArgs e) { //Step 1.Show the authentication window FrmAuthentication authWnd = new FrmAuthentication(); authWnd.OnFinish += new FrmAuthentication.EventHandler(authWnd_OnFinish); authWnd.Show(this); }
private void authWnd_OnFinish(object sender, EventArgs e) { FrmAuthentication authWnd = (FrmAuthentication)sender; if (authWnd.IsOK) { //Step 2. Start to enlist. this.password = authWnd.Password; this.accountName = authWnd.AccountName; Enlist(); //Step 3. Finialize this.Dispose(); } }