由于采用了TopicBar,所以想用最简单的授权方式去做。
原意:
1. 建立一个“权限表”,表里有“用户名”,“模块”,“子模块”,“不可见”列;单击模块列自动显示所有的TopicBar.Pages,编辑“子模块”时自动显示“模块”下的所有TopicBar.Pages().Links.
2. 在权限表的“PrepareEdit”事件中写入如下代码,编译没有问题,但运行时提示错误。不知道哪出现问题了。
代码:
Select Case e.Col.Name
Case "子模块"
Dim s As String = e.Row("模块") 'TopicBar.Pages
Dim lnkname As String
If s > "" Then
If e.IsFocusCell Then
Dim tp As WinForm.TopicPage
tp = Forms("Navi").Controls("TopicBar1").Pages(s)
For Each lk As WinForm.TopicLink In tp.Links
lnkname = lnkname & " | " & lk.Name
Next
e.Col.ComboList = lnkname
End If
End If
运行时提示错误:
此主题相关图片如下:1.jpg


此主题相关图片如下:2.jpg

请大神指点。