设置“网络图”视图中方框的样式。
语法
expression。 BoxStylesEdit( _Style_, _DataTemplate_, _HorizontalGridlines_, _VerticalGridlines_, _BorderShape_, _BorderColor_, _BorderWidth_, _BackgroundColor_, _BackgroundPattern_ )
expression:表示 Application 对象的变量。
参数
| 名称 | 必需/可选 | 数据类型 | 说明 |
|---|---|---|---|
| 样式 | 必需 | Long | 要更改的方框样式。 可为 PjBoxStyle 常量之一。 |
| DataTemplate | 可选 | String | 用于样式的数据模板的名称。 |
| HorizontalGridlines | 可选 | Boolean | 如此 如果水平网格线分隔各行中;否则为 假 。 |
| VerticalGridlines | 可选 | Boolean | 如此 如果垂直网格线分隔方框; 中的每个行否则为 假 。 |
| BorderShape | 可选 | Long | 方框边框的形状。 可为 PjBoxShape 常量之一。 |
| BorderColor | 可选 | Long | 方框边框的颜色。 可以是 PjColor 常量之一。 |
| BorderWidth | 可选 | Long | 取值范围为 1 到 4,以像素为单位指定方框边框的宽度。 |
| BackgroundColor | 可选 | Long | 方框背景的颜色。 可以是 PjColor 常量之一。 |
| BackgroundPattern | 可选 | Long | 背景图案。 可以是 PjBackgroundPattern 常量之一。 |
返回值
Boolean
说明
若要显示 "方框样式" 对话框,请使用 BarBoxStyles 方法。
若要编辑颜色可以是 RGB 值的方框链接线,请使用 BoxStylesEditEx 方法。
示例
下面的示例将更改为 pjBoxCritical 样式显示为圆角矩形框、 添加垂直网格线,并设置的边框和背景色。
Sub BoxStyles_Edit()
'Activate the Network Diagram view
ViewApply Name:="Network Diagram"
BoxStylesEdit Style:=pjBoxCritical, BorderShape:=pjBoxRoundedRectangle, VerticalGridlines:=True, _
BorderColor:=pjRed, BorderWidth:=3, _
BackgroundColor:=pjGray, BackgroundPattern:=pjBackgroundLightDither
End Sub
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。