多屏表格对齐-VB6 [英] Multi screen form alignment-VB6

查看:76
本文介绍了多屏表格对齐-VB6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.

她是另一匹问题的马. (VB6)

我有一个表格,如果需要的话,用户可以选择对齐到左侧边缘.
如果需要,此功能也可以跨显示器使用,也可以只限于扩展桌面布置中的许多屏幕之一.

我想允许用户向左边缘将表单对齐到当前正在运行该表单的特定监视器.现在,如果将窗体拖动到任何一个监视器后都在该监视器上运行,并且启用了左对齐,则它将左对齐到监视器0,我希望它左对齐到当前正在运行的监视器.我目前仅将表单的.Left设置为0.如何检测当前表单运行位置的准确"Left 0"偏移量?潜在的用户群是多屏用户",因此该表单可以发现自己正在许多监视器中的其中之一上运行.

而且也不想重新发明轮子.

谢谢,

:Ron

Hi all.

Her is a horse of a different problem. (VB6)

I have a form that the user can opt to snap to the left edge if the screen if desired.
This for can also span across monitors if desired or be confined to just one of many screens in an extended desktop arrangement.

I would like to allow the user to left edge snap the form to the particular monitor the form is currently running on. Right now if the form is running on any of the monitors after having been dragged there, and the left snap is enabled, it will left snap to monitor 0, and I want it to left snap to the monitor it is currently running on. I currently just set the form''s .Left to 0. How would I detect an accurate "Left 0" offset of where my form is currently running? The potential user base is "multi screen happy" so the form could find itself running on one of many monitors.

And don''t want to reinvent the wheel.

Thanks,

:Ron

推荐答案

您必须首先检测有多少个监视器以及以什么方向放置.如果监视器1位于右侧,则监视器2的X坐标将全部为负.如果监视器2在右边,则所有X坐标都高于监视器1的分辨率.

完成此操作后,轻松捕捉到适当的边缘即可.
You have to first detect how many monitors there are, and in what orientation. If monitor 1 is on the right side, monitor2''s X coordinates will all be negative. If monitor 2 is on the right, all X coords with be higher than monitor1''s resolution.

Once you''ve done that, snapping to the appropriate edge is easy.


这篇关于多屏表格对齐-VB6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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