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 支持和反馈,获取有关如何接收支持和提供反馈的指南。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈