如何防止主窗体窗口上的子窗体关闭调整大小 [英] How to prevent subform closure on main form window resize

查看:79
本文介绍了如何防止主窗体窗口上的子窗体关闭调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,当我调整主窗体的窗口大小时,任何掉落的子窗体都会出现。在可见区域外关闭。


如果我再次展开窗口,Access会自动重新打开它们,但我仍然希望将它们保持为活动状态。并在记忆中。

有没有人知道如何防止访问关闭它们?

并且在相同的说明中,如果有的话检测这种闭包的方法,与主窗体关闭时发生的闭合相比。

I have noticed that when I resize the window of my main form, that any subforms that "fall" out of the visible area get closed.

Now Access automatically reopens them if I expand the window again, but I would still prefer to keep them "active" and in memory.

Do anyone know a way in which to prevent access from closing them?

And on the same note, if there is a way to detect this kind of closure, compared to closure that happens when the main form closes.

推荐答案

笑脸,


我自己从未见过这种行为,但是我在用户调整屏幕大小时遇到​​了很多问题。以下是我提出的一些解决方案。


1)。我希望Access允许你设置一个Form的最小/最大高度和宽度,就像C#一样,你可以通过挂钩到Forms Resize事件并阻止它们减小超过某个点的大小来模仿它。这有一个副作用,屏幕闪烁,并没有看起来那么好,但是可行。


2)。我首选的方法是在运行时动态调整子表单/列表框的大小以适应表单的大小。如果您的子表单位置很好,这种方法很有效。再次,你挂钩到Forms Resize事件。我甚至已经把它调整到如果他们调整到子窗体不会出现的点我将子窗体设置为不可见。我相信这可以在你的情况下工作,将子窗体设置为不可见并将其移动到左上角。
Smiley,

I have never seen this behavior myself, but I have run into tons of problems with user resizing the screen. Here are a few of the solutions I have come up with.

1). I wish Access would allow you to set the min/max height and width of a Form, much like C# does, you can mimic this though by hooking into the Forms Resize event and preventing them from reducing the size beyond a certain point. This has a side effect that the screen flashes and doesn''t look all that great, but is doable.

2). My prefered method is to dynamically resize the subforms/list boxes at run time to fit the size of the form. This works well if your subforms are in a good location. Again you hook into the Forms Resize event. I have even taken it so far as if they resize to a point that the subform won''t appear I set the subform to be invisible. I believe this could work in your situation, set the subform to invisible and move it to the top left.


Hi Hype,谢谢你的回复。


是的,我同意1.但是,我很好奇你是如何阻止用户减少超过某一点的,你能详细说明你的方法吗?
Hi Hype, and thank you for your reply.

Yes, I do agree with 1. However, Im curious as to how you prevent the users from decreasing beyond a certain point, could you elaborate on your method?


只需2行代码即可。我现在在家,所以我没有任何访问代码,所以它可能有拼写错误,但它应该让你知道该怎么做。

All it takes is 2 lines of code. I am at home right now so I don''t have any of my Access code so it might have misspelling, but it should give you an idea of what to do.

展开 | 选择 | Wrap | 行号


这篇关于如何防止主窗体窗口上的子窗体关闭调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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