创建非矩形表单时遇到问题 [英] Getting problem to Creat nonrectungular Form

查看:92
本文介绍了创建非矩形表单时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个非矩形的表格.
我从codeproject获得了链接.http://www.codeproject.com/KB/cs/customforms.aspx
我按照步骤bt操作,它在我的计算机上无法工作.
我还下载了演示和源代码,但是当我要演示时,它也显示了矩形形式.

请任何人帮我!!!!!!!!!!!!

I am creating a nonrectungular Form.
I got the link from codeproject.http://www.codeproject.com/KB/cs/customforms.aspx
I follow the step bt it could not work in my computer.
I also downloaded the demo and source code but when i am goging to exequet the demo it also shows me rectungular form.

Plz help me any body!!!!!!!!!!!!

推荐答案

啊哈.您是在骗人的时候抓住了本文的作者!

如我所料,建议的方法"创建的表格是矩形的.我已经为这篇文章投票了"1",建议您也这样做,因为即使出于无知,撒谎也是一种巨大的罪过.此代码还有其他问题-请阅读读者的评论.

但是,您可以轻松地创建一个非矩形的表单,甚至可以创建一个整体在中间的表单.当您用鼠标整体单击时,位于窗体下方的窗口将被激活,这证明您的窗体确实不是矩形的.

为此,您只需要修改属性System.Windows.Forms.Control.Region,请参见 http://msdn.microsoft.com/en-us/library/system.windows.forms.control.region.aspx [ http://msdn.microsoft.com/zh-cn/library/system.drawing.region.aspx [
Aha. You caught the author of this article on plain lie!

The forms created by suggested "method" are rectangular, as I expected. I already voted "1" for this article, recommend you to do the same, because telling lies is a great sin, even out of ignorance. There are other problems with this code — read the reader''s comments.

However, you can easily create a non-rectangular form, even a form with a whole in the middle. When you click by a mouse in this whole, the window positioned under your form will be activated, which is a proof that your form is really non-rectangular.

To do that, you simply need to modify the property System.Windows.Forms.Control.Region, see http://msdn.microsoft.com/en-us/library/system.windows.forms.control.region.aspx[^]. As the form is also Control, this trick is applicable to it. You can create regions of many different shapes, see http://msdn.microsoft.com/en-us/library/system.drawing.region.aspx[^].

Good luck,
—SA


这篇关于创建非矩形表单时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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