コード例 #1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     using (frmAccount frm = new frmAccount())
     {
         DialogResult result = frm.ShowDialog(this);
         if (result == DialogResult.OK)
         {
             LoadAccount();
         }
     }
 }
コード例 #2
0
        private void lstAccount_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            int index = this.lstAccount.IndexFromPoint(e.Location);

            if (index != System.Windows.Forms.ListBox.NoMatches)
            {
                Item item = (Item)lstAccount.Items[index];
                using (frmAccount frm = new frmAccount(item))
                {
                    DialogResult result = frm.ShowDialog(this);
                    if (result == DialogResult.OK)
                    {
                        LoadAccount();
                    }
                }
            }
        }
コード例 #3
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (lstAccount.SelectedIndex == -1)
            {
                return;
            }

            Item item = (Item)lstAccount.SelectedItem;

            using (frmAccount frm = new frmAccount(item))
            {
                DialogResult result = frm.ShowDialog(this);
                if (result == DialogResult.OK)
                {
                    LoadAccount();
                }
            }
        }