CSharpTutor.Controls.ContactListControl.BtnAddListClick C# (CSharp) Method

BtnAddListClick() private method

will show a new form where the user can enter a new list name to be added
private BtnAddListClick ( object sender, EventArgs e ) : void
sender object sender
e System.EventArgs e
return void
        private void BtnAddListClick(object sender, EventArgs e)
        {
            try
            {
                //clean up the response and request areas
                FrmMain.RequestString = string.Empty;
                FrmMain.ResponseString = string.Empty;

                string strRequest = string.Empty;
                string strResponse = string.Empty;

                var nList = new FrmAddList();
                var dlg = nList.ShowDialog();
                if (dlg == DialogResult.OK)
                {
                    Cursor.Current = Cursors.WaitCursor;

                    var newlyAddedList = OperationsComponent.AddContactList(CredentialsDetails, nList.ListName,
                                                                            out strRequest, out strResponse);

                    Cursor.Current = Cursors.Default;

                    _contactList.Add(newlyAddedList);
                    SetListBox();

                    LstLists.SetSelected(LstLists.FindString(newlyAddedList.Name), true);
                }

                FrmMain.RequestString = strRequest;
                FrmMain.ResponseString = strResponse;
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, Resources.MessageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            Cursor.Current = Cursors.Default;
        }