private void btnEdit_Click(object sender, EventArgs e)
        {
            int index = lstMessageSummary.SelectedIndex;

              if (index < 0)
                  return;

              MessageFormat mf = (MessageFormat)lstMessageSummary.Items[index];

              if (companyMessages.Contains(mf))
                  return;

              addLocalMessageForm = new AddMessageForm(this, MessageType.Local, index);
              addLocalMessageForm.ShowDialog();
        }
 private void btnAddMessage_Click(object sender, EventArgs e)
 {
     try
        {
             addLocalMessageForm.ShowDialog();
        }
        catch (Exception)
        {
             addLocalMessageForm = new AddMessageForm(this, MessageType.Local);
             addLocalMessageForm.ShowDialog();
        }
 }
 private void btnAddMessage_Click(object sender, EventArgs e)
 {
     addLocalMessageForm = new AddMessageForm(this, MessageType.Local, -1);
            addLocalMessageForm.ShowDialog();
 }
 private void btnAddCompanyMessage_Click(object sender, EventArgs e)
 {
     try
        {
            AddCompanyForm.Show();
        }
        catch (Exception)
        {
             AddCompanyForm = new AddMessageForm(this, MessageType.Company);
             AddCompanyForm.Show();
        }
 }