treeview中节点,我想双击之后弹出另一个窗体
treeview中节点,我想双击之后弹出另一个窗体
private Point pi;
private void treeView1_MouseDown(object sender, MouseEventArgs e)
{
pi = new Point(e.X, e.Y);
}
private void treeView1_DoubleClick(object sender, EventArgs e)
{
TreeNode node = this.treeView1.GetNodeAt(pi);
if (pi.X > node.Bounds.Left && pi.X < node.Bounds.Right)
{
SM sm = new SM();
sm.Show();
}
}
但是为什么
if (pi.X > node.Bounds.Left && pi.X < node.Bounds.Right)
{
SM sm = new SM();
sm.Show();
}
不执行
------解决方案--------------------兄弟,用这个事件吧
NodeMouseDoubleClick:
private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
SM sm = new SM();