Table of contents
TOC
折叠目录
展开目录

CommandBarComboBox.Height 属性 (办公室)CommandBarComboBox.Height Property (Office)

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

获取或设置CommandBarComboBox控件的高度。读/写。Gets or sets the height of a CommandBarComboBox control. Read/write.

请注意 已通过 Microsoft Office 流畅的用户界面的新功能区组件取代某些 Microsoft Office 应用程序中的命令栏使用。有关更多信息,请搜索帮助关键字"功能区"。Note The use of CommandBars in some Microsoft Office applications has been superseded by the new ribbon component of the Microsoft Office Fluent user interface. For more information, search Help for the keyword "ribbon."

语法Syntax

表达式高度expression. Height

表达式_一个表示CommandBarComboBox对象的变量。_expression A variable that represents a CommandBarComboBox object.

返回值Return Value

IntegerInteger

示例Example

本示例将自定义控件添加到命令栏命名自定义。示例设置该自定义控件的高度为命令栏高度的两倍,并设置该控件的宽度为 50 像素。请注意命令栏如何自动调整自身以适应控件。This example adds a custom control to the command bar named Custom. The example sets the height of the custom control to twice the height of the command bar and sets the control's width to 50 pixels. Notice how the command bar automatically resizes itself to accommodate the control.

Set myBar = CommandBars("Custom") 
barHeight = myBar.Height 
Set myControl = myBar.Controls _ 
    .Add(Type:=msoControlButton, _ 
    Id:= CommandBars("Standard").Controls("Save").Id, _ 
     Temporary:=True) 
With myControl 
    .Height = barHeight * 2 
    .Width = 50 
End With 
myBar.Visible = True

另请参阅See also

概念Concepts

CommandBarComboBox 对象CommandBarComboBox Object

其他资源Other resources

CommandBarComboBox 对象成员CommandBarComboBox Object Members

© 2018 Microsoft