项目中有很多表,在每个表窗口中设置一个打印列按钮,按钮的代码能不能加入到项目事件或全局表事件当中呢?省的每个表都得重复加按钮代码
表中代码如下:
Dim l As Integer = Tables("鲁H78062").LeftCol
Dim r As Integer = Tables("鲁H78062").RightCol
For Each c As Col In Tables("鲁H78062").cols
If c.index < l OrElse c.Index > r Then
c.Visible=False
End If
Next
Tables("鲁H78062").Print(True,False)
For Each c As Col In Tables("鲁H78062").cols
c.Visible=True
Next