if tlistview(self.activecontrol)<>nil then ...可以在listview的onclick事件里加上这样几句: btnimportexcel(导入Excel按钮).tag:=Integer(Pointer(listview)); 在btnimportexcel.onclick里: Tlistview(Pointer(btnimportexcel.tag))就是你要的的listview了.可以参考: http://blog.csdn.net/iseekcode/archive/2009/10/31/4751344.aspx
var lastobj:Tcomponent; //Tlistview;每个listview的onexit事件里: lastobj:=sender;在按钮事件里对lastobj进行处理
既然是NoteBook那就根据NoteBook的pageindex判断就好了. 比如: case notebook.pageindex of 0:listview1.... 1:listview2.... ..... end;
用PageControl还是NoteBook
还是在窗体上列了几个?
最好用PageControl之类的
点导入时,根据这个变量的值来判断该怎么做.
btnimportexcel(导入Excel按钮).tag:=Integer(Pointer(listview));
在btnimportexcel.onclick里:
Tlistview(Pointer(btnimportexcel.tag))就是你要的的listview了.可以参考:
http://blog.csdn.net/iseekcode/archive/2009/10/31/4751344.aspx
var
lastobj:Tcomponent; //Tlistview;每个listview的onexit事件里:
lastobj:=sender;在按钮事件里对lastobj进行处理
既然是NoteBook那就根据NoteBook的pageindex判断就好了.
比如:
case notebook.pageindex of
0:listview1....
1:listview2....
.....
end;