如何在底部第二个表单vb.net上制作表单 [英] how to make form on bottom second form vb.net

查看:83
本文介绍了如何在底部第二个表单vb.net上制作表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望 Form2 位于 Form1 的底部,就像旧的Winamp媒体播放器一样。

I would like Form2 location to be at the bottom of the Form1 like the old Winamp media player.

推荐答案

这对您来说有多复杂:



创建第二个表格isn'不复杂:你只需要创建实例并调用Show方法而不是ShowDialog。

然后你可以设置它的位置(如果你已经将StartPosition属性设置为Manual)父表单显示的事件 - 只需将其设置为父表单位置,加上父表单大小,加上您想要的任何保证金。



当您想要移动时出现并发症第二种形式与第一种形式相同,但这并不算太糟糕:只需处理Parent Move事件并同时移动Child形式。



但是如果用户移动子表单,如果父移动也是如此?如果是这样,那么你也需要处理Child Move事件,并且还要阻止Parent移动的永久循环导致Child移动事件,这会导致Parent移动,....



但是你可以通过少量的游戏来实现目标!
How complex this is gets to be up to you:

To create a second form isn''t complex: you just need to create the instance and call the Show method instead of ShowDialog.
You can then set it''s location (provided you have set the StartPosition property to Manual) in the parent forms Shown event - just set it to the Parent form Location, plus the Parent form Size, plus any margin you want.

The complications come when you want to move the second form with the first, but that''s not too bad: just handle the Parent Move event and move the Child form at the same time.

But if the user moves the Child form, should the Parent Move as well? If so, then you need to handle the Child Move event as well, and also prevent an eternal loop of the Parent move causing a Child move event, which causes a Parent move, which....

But a small amount of playing you get you there!


这篇关于如何在底部第二个表单vb.net上制作表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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