控件或子窗体控件在调整大小时对于此位置太大 [英] The control or subform control is too large for this location on resize

查看:74
本文介绍了控件或子窗体控件在调整大小时对于此位置太大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Access 2003中有一个简单的表单.该表单有一个List控件和一个按钮.我想使列表使用窗体(仅垂直)调整大小,同时按钮保持在列表的右下角.我在表单的resize事件上使用以下代码.

I have a simple form in Access 2003. The form has a List control and a button. I wanted to make the list to resize with the form (only vertically) while the button remains at the bottom right of the List. I'm using the following code on the form's resize event.

list.Height = Me.InsideHeight - list.Top - 200
commandButton.Top = list.Height + list.Top + 50

这在我调整表单大小时效果很好,直到表单高度达到一定高度.然后我得到这个错误;

This works fine as I resize the form, until the form height gets to a certain height. Then I get this error;

运行时错误"2100": 该位置的控件或子窗体控件太大

Run-time error '2100': The control or subform control is too large for this location

此错误发生在我分配 commandButton.Top 的行.如果我删除此行,则列表高度会很好地变化.表单中没有任何子表单.

This error is occurring at the line where I'm assigning the commandButton.Top. If I remove this line then the list height changes fine. I don't have any subforms in the form.

有人知道为什么会这样吗?

Does anyone know why this is happening?

谢谢

推荐答案

我认为这是因为您需要首先调整表单的detail部分的大小.

I think it is because you need to resize the detail section of the form first.

尝试将代码更改为

Me.Section(0).Height = Me.InsideHeight 
list.Height = Me.InsideHeight - list.Top - 200 
commandButton.Top = list.Height + list.Top + 50

这篇关于控件或子窗体控件在调整大小时对于此位置太大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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