http://blog.csdn.net/zhzuo/archive/2004/04/05/22027.aspx
http://blog.csdn.net/zhzuo/archive/2004/04/05/22028.aspx
http://blog.csdn.net/zhzuo/archive/2004/04/05/22029.aspx
http://blog.csdn.net/zhzuo/archive/2004/04/05/22028.aspx
http://blog.csdn.net/zhzuo/archive/2004/04/05/22029.aspx
TreeNode ttc = this.treeView.SelectedNode;//这东西是取得树接点的名称
Ctl ct = new Ctl(ttc.Text );
ct.ShowDialog();
ct.Dispose();
另一个窗体
public Ctl(string strID) //传近来的为构造函数 strID == ttc.Text
{
// 该调用是 Windows 窗体设计器所必需的。
InitializeComponent();
strID1=strID;
straddress=getaddress(strID1);
comterm.Changed += new ChangedEventHandler(this.OnComm);
// TODO: 在 InitializeComponent 调用后添加任何初始化
}
public string getaddress(string strID)
{
try
{
string strReturn;
string strSql2 = "Select * From terminal where terminal_name = '"+strID+"'";
mycon2 = new OleDbConnection(cnn);
//OleDbCommandBuilder Cmd2;
OleDbdapt2 = new OleDbDataAdapter(strSql2,mycon2);
dsT2 = new DataSet();
OleDbdapt2.Fill(dsT2,"terminal");
strReturn=dsT2.Tables[0].Rows[0].ItemArray[1].ToString();
mycon2.Close();
return strReturn;
}
catch(Exception ex)
{
return ex.Message;
}
}
http://dev.csdn.net/develop/article/26/26434.shtm
http://dev.csdn.net/develop/article/26/26436.shtm
public static classname