MDI儿童表格开始位置问题 [英] MDI Child Form Start Position Problem

查看:115
本文介绍了MDI儿童表格开始位置问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MDI子窗体的开始位置出现这个奇怪的问题。
这里是我的开始位置代码,我希望它是
中间左边的MDI父窗体。

  //显示任务栏
ChildForm c1 = new ChildForm();

c1.MdiParent = this;
c1.StartPosition = FormStartPosition.Manual;
c1.Location = new Point(0,this.Height / 2);

奇怪的是我每次启动我的Mdi父窗体时,垂直滚动条显示
并且mdi子表单的位置低于MDI父表单高度的一半。
然后,如果向下滚动滚动条以查看整个mdi子表单,滚动条就会消失。

在此之后,无论如何更改大小的mdi父窗体,滚动条将
不再显示。



有人知道为什么吗?

另外,我想知道是否可以隐藏一个mdi子表单只有一个类似控制柄的控件在mdi父窗体中留下
。如果用户点击该句柄,则表单再次显示。如果用户
点击其他地方,表单隐藏。它有点像Window任务栏。



我尝试使用form.hide(),但是它隐藏了整个mdi子表单。

谢谢



Alex

解决方案

请注意顶部的窗口栏。



你可以看看 PointToClient PointToScreen


I am having this strange problem with the start position of the MDI child Form. Here is my code for the start position, I wanted it to be the middle left of the MDI Parent Form.

        //show the task bar
        ChildForm c1 = new ChildForm();

        c1.MdiParent = this;
        c1.StartPosition = FormStartPosition.Manual;
        c1.Location = new Point(0, this.Height/2);

Strange thing is every time I start my Mdi parent form, the vertical scrollbar show up and the mdi child form is position lower than half of the MDI parent form's height. Then if I scroll the scroll bar down to see the whole mdi child form, the scrollbar disappear.

After this point, no matter how I change the size of the mdi parent form, the scrollbar will not show up again.

Does Anybody knows Why?

Also, I was wondering if it is possible to hide a mdi child form with only a handle-like control left in the mdi parent form. If the user click that handle, then the form show up again. If the user click somewhere else, the form hide. It is kind of like Window taskbar.

I tried to use form.hide(), but it hides the whole mdi child form.

Thanks

Alex

解决方案

Is is possible that your calculation is taking into account the windows bar at the top.

You can have a look at PointToClient or PointToScreen

这篇关于MDI儿童表格开始位置问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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