测试时:For Each page As WinForm.NavPage In nv.NavPages
For Each tp As WinForm.TopicBar In page.Children
For Each pg As WinForm.TopicPage In e.Form.Controls(tp.Name).Pages
For Each tl As WinForm.TopicLink In pg.Links
pg.Visible = False
tl.Visible = False
Dim Filter As String = "用户 like '%" & User.Name & "%' "
For Each s As String In User.Roles.split(",")
Filter = Filter & " or 用户 like '%" & s & "%'"
Next
Filter = "(" & Filter & ")"
For Each dr As DataRow In DataTables("导航授权").SQLSelect( Filter)
If dr.IsNull("任务栏页面") = False and dr.IsNull("任务栏") = False Then
' msgbox(dr("任务栏"))
' msgbox(dr("任务栏页面"))
tp.Pages(dr("任务栏")).Visible = True
pg.Links(dr("任务栏页面")).Visible = True
Else
If dr.IsNull("任务栏") = False Then
msgbox(dr("任务栏"))
tp.Pages(dr("任务栏")).Visible = True
End If
End If
Next
Next
Next
Next
Next
第一次可以显示任务栏名称和任务栏页面名称一次,接着就显示“未设置对象变量或 With 块变量。”不知道怎么修改?