示例#1
0
        private void listViewInbox_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            ListViewItem item = listViewInbox.SelectedItems[0];
            string from = item.SubItems[1].Text;
            string subject = item.SubItems[2].Text;
            string body = item.SubItems[3].Text;
            string date = item.SubItems[4].Text;

            ShowMessage showMessage = new ShowMessage(from, subject, body, date);

            showMessage.Show();
        }
示例#2
0
        private void showByNumberToolStripMenuItem_Click(object sender, EventArgs e)
        {
            InputNumberForm inputNumberForm = new InputNumberForm();
            inputNumberForm.ShowDialog();

            if ((listViewInbox.Items.Count > inputNumberForm.number - 1) && (inputNumberForm.number - 1 >= 0))
            {
                ListViewItem item = listViewInbox.Items[inputNumberForm.number - 1];
                string from = item.SubItems[1].Text;
                string subject = item.SubItems[2].Text;
                string body = item.SubItems[3].Text;
                string date = item.SubItems[4].Text;
                ShowMessage showMessage = new ShowMessage(from, subject, body, date);
                showMessage.Show();
            }
            else
            {
                MessageBox.Show("There is no message number" + inputNumberForm.number, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }