Table of contents

CommandButton.Transparent 属性 (访问)CommandButton.Transparent Property (Access)

office 365 dev account|上次更新日期: 2018/3/13
2 参与人员

透明属性用于指定命令按钮是否是稳定或不透明。读/写boolean 类型的值You can use the Transparent property to specify whether a command button is solid or transparent. Read/write Boolean.


表达式透明expression. Transparent

表达式_一个表示命令按钮对象的变量。_expression A variable that represents a CommandButton object.


使用BackStyle属性使其他控件的稳定或不透明。Use the BackStyle property to make other controls solid or transparent.

可以使用该属性将透明的命令按钮放在另一个控件上。例如,可以将许多透明按钮放在图像控件内显示的图片上,然后由用户单击图片的不同部分来执行不同的宏或 Visual Basic 事件过程。You can use this property to place a transparent command button over another control. For example, you could place several transparent buttons over a picture displayed in an image control and run various macros or Visual Basic event procedures depending on which part of the picture the user clicks.

请注意 若要隐藏和禁用一个按钮,使用Visible属性。要禁用但并不隐藏按钮,请使用可用属性。若要仅在窗体或报表时,才隐藏按钮打印时,请使用何时显示属性。Note To hide and disable a button, use the Visible property. To disable a button without hiding it, use the Enabled property. To hide a button only when a form or report is printed, use the DisplayWhen property.


下面的示例将使 Purchase Orders(采购订单)窗体上的命令按钮 Preview(预览)成为透明的。The following example makes the command button "Preview" on the "Purchase Orders" form transparent.

Forms.Item("Purchase Orders").Controls.Item("Preview"). _ 
 Transparent = True

另请参阅See also


命令按钮对象CommandButton Object

© 2018 Microsoft