public Whicut(datatable dthistoryprocess,int index) //whicut 是wpf窗体类,此为Whicut构造函数
{
initializecomponent();
}
private void Stem(object tsr) //现想调用Stem此函数
{
Whicut heore=tsr as Whicut
}
按网友方法调用以上Stem这样一个带object参数的函数,用以下语句调用:
//传参数
Whicut prams=new Whicut(datatable dthistoryprocess,int index);
//调用
Stem(prams);
出现错误提示:不包含采用“1”个参数的构造函数
求高手解惑,谢谢!
new Whicut 时参数传错了,改为
Whicut prams = new Whicut(dthistoryprocess, index);
改了,但错误提示:当前上下文中不存在dthistoryprocess与index
DataGrid dataGrid=(DataGrid) sender;
DataView dv=(DataView)dataGrid.ItemsSource;
DataTable dt=dv.ToTable();
Whicut ts=new Whicut(dt,1);
Stem(ts);
自己解决了,谢谢大家!