右健
代码如下:
TreeNode treeNodeClone =new TreeNode ();
private void 复制ToolStripMenuItem2_Click(object sender, EventArgs e)
{
if (elementtreeView .SelectedNode != null)
{
treeNodeClone = (TreeNode)elementtreeView.SelectedNode.Clone();
}
}
private void 剪切ToolStripMenuItem2_Click(object sender, EventArgs e)
{
if (elementtreeView.SelectedNode != null)
{
treeNodeClone = (TreeNode)elementtreeView.SelectedNode.Clone();
this.elementtreeView.SelectedNode.Remove();
}
}
private void 粘贴ToolStripMenuItem2_Click(object sender, EventArgs e)
{
if (elementtreeView.SelectedNode.Nodes.Count == 0)
{
elementtreeView.SelectedNode.Nodes.Add(treeNodeClone);
}
else
{
elementtreeView.Nodes.Add(treeNodeClone);
}
写了一部分不会写了,求解……