表单透明键不能很好地工作,我的表单边框是白色的 [英] Form Transparency Key does not work well borders of my form are white

查看:94
本文介绍了表单透明键不能很好地工作,我的表单边框是白色的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作一个四舍五入的表单,我将透明键的颜色设置为System/Control.我的表单看起来像是四舍五入的,但是表单的边框上有白色.

我用.jpeg尝试过,结果是
http://imageupload.org/?d=F615F7D51 [ http://imageupload.org/?d=D6AD74F21 [

I am trying to make a rounded form,I set the Transparency key color as System / Control.My form is looks like rounded but there is white colors on borders of my form.

I am tried with .jpeg the result is
http://imageupload.org/?d=F615F7D51[^]

with png the result is :

http://imageupload.org/?d=D6AD74F21[^]

not bad like .jpeg but there is still white colors on my form.

Thanks in advance.

推荐答案

使用透明效果获得非矩形形式是简单的错误.它看起来很丑陋(如您的图片所示),但主要是,该表单实际上仍然是矩形(惊讶吗?!).

使用鼠标很容易观察到.想象您的表单内部有一个洞.如果在孔内单击鼠标,则应激活下面的窗口.由于您的表单实际上是矩形的,因此鼠标不会感觉"到该孔:单击将激活它或将其保留在顶部.都错了.

同时,正确的决定很简单.您只需要创建一个非矩形的Region,并为其分配表单的属性Region,该属性是由类Form继承的System.Windows.Forms.Control.Region.请参阅
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.region.aspx [
Using transparency effect to obtain a non-rectangular Form is plain wrong. It looks ugly (as your pictures illustrate), but main thing is, the form remains rectangular in fact (surprise?!).

It is easy to observe using the mouse. Imaging you have a form with a hole inside. If you click with a mouse inside the hole, you should activate a windows which is underneath. As you form is really rectangular, the mouse will not "feel" this hole: a click will activate it or it will remain on top. All wrong.

At the same time, a correct decision is simple as a pie. You simply need to create a non-rectangular Region and assign it the the property Region of you form, which is System.Windows.Forms.Control.Region inherited by the class Form. Please see http://msdn.microsoft.com/en-us/library/system.windows.forms.control.region.aspx[^].

If you do this simple step, your form will become truly non-rectangular.

Enjoy,
—SA


这篇关于表单透明键不能很好地工作,我的表单边框是白色的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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