Move 方法示例

以下示例演示如何将 Move 方法与 Controls 集合一起使用来移动窗体上的所有 控件 。 用户单击 CommandButton 以移动控件。

若要使用此示例,请将此示例代码复制到窗体的 Declarations 部分。 Make sure that the form contains a CommandButton named CommandButton1 and several other controls.

Private Sub CommandButton1_Click() 
 'Move each control on the form right 25 points 
 'and up 25 points. 
Controls.Move 25, -25 
End Sub

支持和反馈

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