社区
C#
帖子详情
C#如何设置透明背景色?
wonderful_abc
2006-12-05 11:16:29
在构造方法private void InitializeComponent()中加入
SetStyle(System.Windows.Forms.ControlStyles.SupportsTransparentBackColor, true);
this.BackColor = System.Drawing.Color.Transparent;
可提示说“未找到方法System.Windows.Forms.Form.SetStyle”
何解?谢谢!
...全文
439
6
打赏
收藏
C#如何设置透明背景色?
在构造方法private void InitializeComponent()中加入 SetStyle(System.Windows.Forms.ControlStyles.SupportsTransparentBackColor, true); this.BackColor = System.Drawing.Color.Transparent; 可提示说“未找到方法System.Windows.Forms.Form.SetStyle” 何解?谢谢!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
tianxingzh
2007-03-16
打赏
举报
回复
收藏!
wdy9927
2006-12-05
打赏
举报
回复
//对,是属性
//像下面这样,窗体就透明了。
this.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(192)), ((System.Byte)(192)));
this.TransparencyKey = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(192)), ((System.Byte)(192)));
wonderful_abc
2006-12-05
打赏
举报
回复
TransparencyKey在什么地方?
是什么类的属性吗(XXX.TransparencyKey)?
wonderful_abc
2006-12-05
打赏
举报
回复
To: junsir()
SetStyle()是个静态方法。
wdy9927
2006-12-05
打赏
举报
回复
可以通过设置TransparencyKey。
然后把 form 背景设置为相同的颜色,这样form就透明了。
junsir
2006-12-05
打赏
举报
回复
SetStyle()
这个方法你有定义吗?
在哪里定义的?
C#
WinForm开发:将控件
背景色
设置
为
透明
以pictureBox控件上label控件为例,
设置
label控件的
背景色
透明
,可以看到pictureBox控件的
背景色
。
处理图片
背景色
,使用
透明
(
C#
)&图片处理程序(含源码)
遇到的问题: 1。MakeTransparent转换
透明
背景,保存后
背景色
变成黑色 2。转化后图片清晰度发生了变化(处理后有黑色像素化点) 3.效率不好。。 ============== 经过几天的模索、找资料、研究 1。保存后
背景色
不会变黑色(已测,在PS和页面中确已
透明
) 2。清晰度只有一点细微变化,处理后依然很清晰,黑色像素点,已解决 3。效率高了很多。。
C#
高级程序设计
为什么要学习
C#
?
C#
是微软的**语言,拥有接近20年的历史和广泛的应用。目前国内对
C#
的书籍和视频相对较少,但
C#
和.NET的发展前程是十分光明的,这体现在微软公司本身强劲的实力,
C#
的开源,.NET Core社区的蓬勃发展,以及.NET开发岗位需求的不断增加。
C#
用途广泛,容易上手。可以说,如果你熟悉
C#
语言,你将不愁找不到好的工作。 本课程分为四部分(三层架构、设计模式、多线程、网络编程达人),详细的讲述了一名
C#
中、高级程序员需要学习的各项知识,其中宿舍管理系统实战是重中之重。课程主要特点: 1. 紧跟微软
C#
发展,使用
C#
语言和开发环境版本2. 结合应用案例,力求做到深入浅出,明白易懂3. 重要概念附有英文翻译4. 独家附赠一个面试经验分享,希望每位学生都可以从中受益,在面试中脱颖而出5.含宿舍管理系统的讲解希望本套课程在你学习
C#
的过程中,可以对你有所帮助。
C#
自定义控件
背景色
透明
的方法
解决自定义控件不
透明
的方法。I struggled for ages with the problem of having controls show through a control that was painted on top of them. It seems that ControlStyles.SupportsTransparentBackColor just allowed the control to pick up the container's background colour/image and wouldn't prevent the control from hiding any controls that were underneath it. I eventually found an answer so I thought I would post it here. This code example of a Pointer class, will take an alpha-blended png in the constructor and allow all the controls behind it to show through the transparent or semi-transparent pixels in the png, even when the pointer's location is changed ...
Textbox背景
透明
(winform)
最近在做Winform(
C#
)的项目,需要
设置
Textbox的背景颜色为
透明
,但是Textbox不支持
透明
的属性.在codeproject上找到了一个外国重写的类
C#
110,499
社区成员
642,577
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章