treelist1_DoubleClick事件怎么写? treelist 的DoubleClick事件该怎么写?要实现双击就把值传递到下一个窗体。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 有以下几种方法:1.新窗体构造函数加上参数2.新窗体加个公共属性在form.show()之前进行赋值 首先要获取treelist双击时的node,再把相关值传送如: treelistNode node=treelist.FocusedNode; form2 s=new form(node.getValue().tostring()); s.show(); 我是这样做的public delegate void TreelistDoubleClick();public TreelistDoubleClick m_TreelistDoubleClick; private void treeList1_DoubleClick(object sender, EventArgs e) { if (m_TreelistDoubleClick != null) m_TreelistDoubleClick(); MessageBox.Show("DoubleClick"); //treelistNode node = treelist1.FocusedNode; //textEdit1.Text = node.getValue().tostring(); //form2 s = new form(node.getValue().tostring()); //s.show(); } 你的form2的构造函数需要修改public partial class form2: Form{ string parmvalue; public form2(string nodevalue) { InitializeComponent(); parmvalue = nodevalue }} 上面的上了一个;在这句parmvalue = nodevalue; 就是:treelistNode node=treelist.FocusedNode; 这句出错了、! public delegate void TreelistDoubleClick(); public TreelistDoubleClick m_TreelistDoubleClick; private void treeList1_DoubleClick(object sender, EventArgs e) { if (m_TreelistDoubleClick != null) m_TreelistDoubleClick(); MessageBox.Show("DoubleClick"); //treelistNode node = treelist1.FocusedNode; textEdit1.Text = this.treeList1.FocusedNode.GetValue("字段名").ToString(); //form2 s = new form(node.getValue().tostring()); //s.show(); } 是不是出现null值了.你自己捕获一下当前点击的是哪个节点啊.上面我只是举下例子而已point p=treelist1.PointToClient(mousePostion);treelistInfo info=treelist1.calInfo(p);treelistnode node=info.node;if(node!=null) form2 s=new form2(node.getvalues("列值").tostring());s.show(); 小弟数学不好。。。肿么办? C# winHTMLEditorControl 编辑器问题 ado.net 一个事务未结束,会阻塞另一个事务吗? C# 转码汉字丢失? nhibernate查询常量的问题 窗体信息传递 求助 DataSet遇到的一个奇怪的问题 如何访问DBF文件,并如何对其的内容进行更改 custDA.InsertCommand.Parameters.Add("@CustomerID", OdbcType.Char, 5, "CustomerID"); 小弟菜鸟,求助C#专家进来解答 C#中调用C++的dll的参数为指针类型的导出函数 各位大虾帮帮忙啊 关于反射
1.新窗体构造函数加上参数
2.新窗体加个公共属性在form.show()之前进行赋值
如:
treelistNode node=treelist.FocusedNode;
form2 s=new form(node.getValue().tostring());
s.show();
public delegate void TreelistDoubleClick();
public TreelistDoubleClick m_TreelistDoubleClick; private void treeList1_DoubleClick(object sender, EventArgs e)
{
if (m_TreelistDoubleClick != null)
m_TreelistDoubleClick();
MessageBox.Show("DoubleClick");
//treelistNode node = treelist1.FocusedNode;
//textEdit1.Text = node.getValue().tostring();
//form2 s = new form(node.getValue().tostring());
//s.show();
}
{
string parmvalue;
public form2(string nodevalue)
{
InitializeComponent();
parmvalue = nodevalue
}
}
public TreelistDoubleClick m_TreelistDoubleClick; private void treeList1_DoubleClick(object sender, EventArgs e)
{
if (m_TreelistDoubleClick != null)
m_TreelistDoubleClick();
MessageBox.Show("DoubleClick");
//treelistNode node = treelist1.FocusedNode;
textEdit1.Text = this.treeList1.FocusedNode.GetValue("字段名").ToString();
//form2 s = new form(node.getValue().tostring());
//s.show();
}
上面我只是举下例子而已point p=treelist1.PointToClient(mousePostion);
treelistInfo info=treelist1.calInfo(p);
treelistnode node=info.node;
if(node!=null)
form2 s=new form2(node.getvalues("列值").tostring());
s.show();