形状不规则的Windows窗体(C#) [英] Irregular shaped Windows Form (C#)

查看:280
本文介绍了形状不规则的Windows窗体(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是做到这一点的最简单的方法是什么?是否有可能与管理code?

感谢您的时间。

解决方案

  this.BackgroundImage = //图片
this.FormBorderStyle = FormBorderStyle.None;
this.Width = this.BackgroundImage.Width;
this.Height = this.BackgroundImage.Height;
this.TransparencyKey = Color.FromArgb(0,255,0); //对比度色彩
 

这允许您根据在图像上创建一个表单,并使用透明度指数,使其看起来好像形式不是矩形的。

What is the easiest way to do this? Is it possible with managed code?

Thanks for your time.

解决方案

this.BackgroundImage = //Image
this.FormBorderStyle = FormBorderStyle.None;
this.Width = this.BackgroundImage.Width;
this.Height = this.BackgroundImage.Height;
this.TransparencyKey = Color.FromArgb(0, 255, 0); //Contrast Color

This allows you to create a form based on an image, and use transparency index to make it seem as though the form is not rectangular.

这篇关于形状不规则的Windows窗体(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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