TREEVIEW控件节点上单击鼠标右键时获得该节点的节点名
Sample code as follows:
//in your mouse-down event
if( e.Button == MouseButtons.Right )
{
TreeNode tnCurrent = yourTreeView.GetNodeAt( e.X, e.Y );
if( tnCurrent != null )
MessageBox.Show( tnCurrent.Text );
}
//this.textBox1.Text=this.treeView1.SelectedNode.Text.ToString();
//in your mouse-down event
if( e.Button == MouseButtons.Right )
{
TreeNode tnCurrent = yourTreeView.GetNodeAt( e.X, e.Y );
if( tnCurrent != null )
MessageBox.Show( tnCurrent.Text );
}
//this.textBox1.Text=this.treeView1.SelectedNode.Text.ToString();