Example #1
0
        private void button_add_Click(object sender, EventArgs e)
        {
            CustomReplyEdit edit = new CustomReplyEdit();

            edit.ShowDialog();
            if (edit.strs.Length > 2)
            {
                ListViewItem item = new ListViewItem();
                item.Checked = true;
                item.SubItems.Add(edit.strs[0]);
                item.SubItems.Add(edit.strs[1]);
                item.SubItems.Add(edit.strs[2]);
                listView_reply.Items.Add(item);
            }
        }
Example #2
0
 private void button_edit_Click(object sender, EventArgs e)
 {
     if (listView_reply.FocusedItem != null)
     {
         CustomReplyEdit edit      = new CustomReplyEdit();
         ListViewItem    foucsItem = listView_reply.FocusedItem;
         edit.SetStrs(foucsItem.SubItems[1].Text, foucsItem.SubItems[2].Text, foucsItem.SubItems[3].Text);
         edit.ShowDialog();
         if (edit.strs.Length > 2)
         {
             foucsItem.SubItems[1].Text = edit.strs[0];
             foucsItem.SubItems[2].Text = edit.strs[1];
             foucsItem.SubItems[3].Text = edit.strs[2];
         }
     }
 }