Beispiel #1
0
        private void tImg_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            TreeNode node = tImg.SelectedNode;

            if (node == null)
            {
                return;
            }

            ImageInfo ii = tImg.SelectedNode.Tag as ImageInfo;

            switch (e.KeyCode)
            {
            case Keys.Delete:

                if (ii.Delete())
                {
                    tImg.Nodes.Remove(tImg.SelectedNode);
                }
                break;

            case Keys.F2:

                tImg.LabelEdit = true;
                tImg.SelectedNode.BeginEdit();
                break;
            }
        }
Beispiel #2
0
        private void miImgDelete_Click(object sender, System.EventArgs e)
        {
            ImageInfo ii = tImg.SelectedNode.Tag as ImageInfo;

            if (ii.Delete())
            {
                tImg.Nodes.Remove(tImg.SelectedNode);
            }
        }