示例#1
0
 void AddNewItem()
 {
     using (var form = new FormItem())
     {
         try
         {
             if (treeView1.SelectedNode.Parent == treeView1.Nodes[0])
             {
                 form.SetCategory(treeView1.SelectedNode.Text);
             }
         }
         catch { }
         form.ShowDialog();
     }
 }
示例#2
0
 private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         var item = listView1.GetItemAt(e.X, e.Y);
         if (item == null)
             return;
         else if (item.Tag is ReminderCreator)
         {
             using (var form = new FormCreator((ReminderCreator)item.Tag))
             {
                 form.ShowDialog();
             }
         }
         else if (item.Tag is ReminderItem)
         {
             using (var form = new FormItem((ReminderItem)item.Tag))
             {
                 form.ShowDialog();
             }
         }
     }
 }