将子表格放在同一屏幕中,母表格放置(使用双显示器时) [英] Get the child form in the same screen, where the mother form lays (when using dual monitors)

查看:105
本文介绍了将子表格放在同一屏幕中,母表格放置(使用双显示器时)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b

我正在使用与我开发的笔记本电脑连接的独立LED屏幕。当我创建一个新表单时,它总是出现在另一个屏幕中(如果母亲表单在screen1子表单中出现在屏幕2中,如果母表单在屏幕2中,则子表单出现在screen1中)。我使用以下传统代码来做到这一点。



Hi
I am using a separate LED screen connected with my developing laptop. When I create a new form it always appear in the other screen (if Mother form is in screen1 child form appear in screen 2 and if Mother form is in screen 2 child form appear in screen1). I am using following conventional code to do that.

Form1 frm = new Form1();
frm.ShowDialog();





请建议我把孩子表格放在同一个屏幕上,母亲表格下蛋。



感谢您的帮助,

Kushan Randima。

软件工程师

Davton有限公司



Please advice me to get the child form in the same screen, where the mother form lays.

Thanks for helping,
Kushan Randima.
Software Engineer
Davton Ltd

推荐答案

嗨Kushan,检查子窗体属性窗口。有一个名为Start Position的房产。将Windows默认绑定值更改为CenterParent。
Hi Kushan, check the child form property window. There is a property named "Start Position". Change the "Windows default bound" value to "CenterParent".


frm.StartPosition = CenterParent



这应该做的伎俩:)

您可能必须使用命名空间/ Enum来限定centerParent,我现在不记得(可能是FormPosition)



如果这样帮助,请花时间接受解决方案。谢谢。
frm.StartPosition = CenterParent

This should do the trick :)
You might have to qualify centerParent with the namespace / Enum which I cannot recall at the moment (probably FormPosition)

If this helps, please take time to accept the solution. Thank you.


这篇关于将子表格放在同一屏幕中,母表格放置(使用双显示器时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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