以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  listview 的RowActivate内的vars变量是否无法传递到其他窗口?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=77431)

--  作者:ehomecd
--  发布时间:2015/11/18 11:04:00
--  listview 的RowActivate内的vars变量是否无法传递到其他窗口?
listview 的RowActivate内的vars变量是否无法传递到其他窗口?

RowActivate写代码

Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
Dim vr As WinForm.ListViewRow = lvw.Current \'获取ListView的当前行
If vr Is Nothing Then \'如果不存在当前行,也就是内有选定任何一行
    Return
End If
Dim dr As DataRow = vr.tag \'获取此行对应的DataRow
vars("name") = dr("姓名")
vars("xsbh") = dr("学生编号")

打开其他窗口的时候,这个vars("name") 的变量值并没有传递,是否是listview不能传递vars变量?

--  作者:大红袍
--  发布时间:2015/11/18 11:06:00
--  

肯定是可以传递的。

 

在最后加一个msgbox(vars("name"))