Private Sub Form_BeforeRender(ByVal drawObject As Object, ByVal chartObject As Object, ByVal Cancel As Object)
drawObject 对ChChartDraw 对象的引用。请使用返回对象的 DrawType 属性来判断将发生什么类型的重画。
chartObject 即将提交的对象。使用 TypeName 函数确定对象的类型。
Cancel 将该对象的 Value 属性设为 True 可取消“数据透视图视图”对象的提交。
下面的示例显示了捕获 BeforeRender 事件的子例程的语法。
Private Sub Form_BeforeRender( _
ByVal drawObject As Object, _
ByVal chartObject As Object, _
ByVal Cancel As Object)
Dim intResponse As Integer
Dim strPrompt As String
strPrompt = "Cancel render of current object?"
intResponse = MsgBox(strPrompt, vbYesNo)
If intResponse = vbYes Then
Cancel.Value = True
Else
Cancel.Value = False
End If
End Sub