表的click事件:
Select Case e.Col.Name
Case "Code"
Forms("窗口1").open()
End Select
窗口1的AfterLoad事件
‘第一种方法,不能锁定Tab分页夹的子表(子表是一个SqlTable,是在这个Tab中插入了一个SplitContainer分隔开来的)’
‘这里面的主表都是Norm类型的,绑定了数据表且设为了副本且设为允许编辑’
For Each wc As WinForm.Control In e.Form.Controls
If Typeof wc Is winform.Table Then
Dim wt As winform.Table = wc
wt.Table .AllowEdit = ( Tables("表A").Current IsNot Nothing AndAlso Tables("表A").Current("Audit") = False )
End If
Next
'第二种方法好象更无效,因为使用了SplitContainer控件,所以直属于TabPage的控件只有表,这个问题找到
For Each pg As WinForm.TabPage In e.Form.Controls("TabControl1").TabPages
For Each c As WinForm.Control In pg.Children
If Typeof c Is WinForm.Table Then
Dim tb As winform.Table = c
wt.Table .AllowEdit = ( Tables("表A").Current IsNot Nothing AndAlso Tables("表A").Current("Audit") = False )
End If
Next
Next
请教各位,问题在哪里呢?
[此贴子已经被作者于2014-4-20 14:13:17编辑过]