共用方式為


在頁面上移動控制項

下列範例會示範使用 Microsoft Forms 2.0 Controls 集合的 Move 方法移動表單中所有的控制項。 使用者按一下 CommandButton 以移動控制項。

若要使用本範例,請將此範例程式碼複製到表單的 [指令碼編輯器] 中。 請確定該表單包含一個名為 CommandButton1 的 CommandButton 和多個其他控制項。

Sub CommandButton1_Click() 
 Set Controls = Item.GetInspector.ModifiedFormPages("P.2").Controls 
 'Move each control on the form right 25 points and up 25 points. 
 Controls.Move 25, -25 
End Sub

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應