Share via


Move 方法範例

下列範例示範如何使用 Move 方法搭配 Controls 集合 來移動表單上的所有控制項。 使用者按一下 CommandButton 以移動控制項。

若要使用本範例,請將此範例程式碼複製到表單的宣告部分中。 請確定該表單包含一個名為 CommandButton1 的 CommandButton 和多個其他控制項。

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 支援與意見反應