使用VBA在窗体上移动动态创建的控件 [英] Move a dynamic created control on a form using VBA

查看:410
本文介绍了使用VBA在窗体上移动动态创建的控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Excel中,我创建了一个表单。在这个表单上,我创建了3个按钮。

In Excel I have created a form. On this form I have created 3 buttons.

我希望能够在运行时移动这些按钮。

I want to be able to move these button at runtime.

我的问题是如何在运行时引用按钮?

The problem which I have is how do I reference the buttons at runtime?

推荐答案

Private Sub CommandButton1_Click()
  Me.Controls("CommandButton1").Move 0, 0
End Sub

这篇关于使用VBA在窗体上移动动态创建的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆