简体   繁体   English

excel - vba - userform - frame - 设置滚动条位置

[英]excel - vba - userform - frame - set scrollbar position

How do I set the scrollbar position of a frame(inside an userform)? 如何设置框架的滚动条位置(在用户窗体内)?

The case: 案子:

I have a frame in an userform that has dynamic content. 我在userform中有一个具有动态内容的框架。 So if the content is too big to fit the frame, it (dynamically) creates a scrollbar in that frame. 因此,如果内容太大而无法适应框架,则(动态地)在该框架中创建滚动条。 The scrollbar also has dynamic values, following the frame content size. 滚动条还具有动态值,遵循帧内容大小。

The code that updates the scrollbar is as follows: 更新滚动条的代码如下:

With userform1.frame1
    'dynamic size
    .ScrollHeight = param1 * param2
    .ScrollWidth = .InsideWidth * 30
End with

So I'd like to have something to send the scrollbar to the bottom position! 所以我想有一些东西将滚动条发送到底部位置! How do I do that? 我怎么做? Thanks in advance 提前致谢

After setting the ScrollHeight and ScrollWidth and still inside the With block try: 设置ScrollHeight和ScrollWidth后仍然在With块中尝试:

.Scroll ActionX:=fmScrollActionNoChange, ActionY:=fmScrollActionEnd

More details can be found here 更多细节可以在这里找到

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM