Application.ScreenUpdating 属性 (Visio)

确定在一系列操作过程中是否更新(重绘)屏幕。 读/写。

语法

expression.ScreenUpdating

expression:表示 Application 对象的变量。

返回值

整数

备注

使用 ScreenUpdating 属性来提高一系列操作过程中的性能。 例如,当创建一系列形状时,您可以关闭屏幕更新,以便不在出现每个形状后重绘屏幕。 之后您可以打开屏幕更新来更新屏幕。

当屏幕更新关闭时,如果向 Microsoft Visio 实例发送大量命令,Visio 实例偶尔会重新显示屏幕来刷新其缓冲区。

如果程序在关闭屏幕更新后没有打开它,则当用户执行一个操作时,Visio 实例会重新打开屏幕更新。

注意

ShowChangesScreenUpdating 属性的相似之处在于它们都旨在提高一系列操作过程中的性能,但是它们的工作方式不同。 设置 ShowChanges 属性会同时设置 ScreenUpdating 属性,但设置 ScreenUpdating 属性并不会设置 ShowChanges 属性。 有关这两个属性的比较,请参阅 ShowChanges 属性。

示例

以下 Microsoft Visual Basic 代码段显示如何使用 ScreenUpdating 属性。

'Turn off screen updating to improve performance during 
'the series of actions that follow. 
 Visio.Application.ScreenUpdating = False 
 
'Drop several shapes. 
'Set the shapes' text. 
'Connect the shapes. 
'Format the connectors. 
 
'Turn screen updating on again when the actions are complete. 
Visio.Application.ScreenUpdating = True 

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。