我在使用 Excel UserForms 时遇到一个非常奇怪的问题;当我通过单击工作表中的命令按钮来显示表单时,表单的大小会显着变形,使其基本上无法使用。下图说明了这一点。
Form before size warping (intended size)
![Form before size warping (intended size)](https://i.stack.imgur.com/8BvRl.png)
Form after size warping
![Form after size warping](https://i.stack.imgur.com/957zY.png)
我使用多屏幕设置,这个尺寸问题仅在刚使用我的笔记本电脑而没有附加显示器时才出现;然而,即使使用我通常的设置,它现在也开始发生。此外,在某些情况下,翘曲与每个后续形式初始化混合。我在下面提供了示例图像。
Form before warping (intended size)
![Form before warping (intended size)](https://i.stack.imgur.com/Cc1ti.png)
Form after warping (first iteration)
![Form after warping (first iteration)](https://i.stack.imgur.com/rZjzE.png)
Compounded warping (second iteration)
![Compounded warping (second iteration)](https://i.stack.imgur.com/k5h7d.png)
Further compounded warping (third iteration)
![Further compounded warping (third iteration)](https://i.stack.imgur.com/cUIWY.png)
我尝试通过属性窗口和 Userform_Initialize() 事件手动设置高度和宽度属性,但最终仍然得到奇怪的结果。在属性窗口中,我输入的高度和宽度值在输入后会自动更改,通常会导致不理想的纵横比,并且当我尝试使用 VBA 调整大小时也会发生类似的情况。我不认为代码是问题,因为我只是设置 .Height 和 .Width 属性,因此没有太多出错的空间。
我进行了相对广泛的研究,但未能找到有关此问题的任何信息。我使用的是 Excel 2016;任何帮助,将不胜感激!
我认为你的问题可能与我的有关here.
@Lance Phillips:我使用 Excel 2016 32 位 Windows 10 64 位时缺少您所指的选项(下图是在网络上找到的)。我不知道为什么。即使连接了额外的显示器。
![enter image description here](https://i.stack.imgur.com/UVZtZ.jpg)
编辑:显然这是 Office build 9330.1000 的新功能,请参阅here.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)