控制不透明度 [英] Opacity on Control

查看:39
本文介绍了控制不透明度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将控件设为半透明?

Is it possible to make a control semi-transparent?

推荐答案

如果控件支持透明背景,可以使用 Color.FromArgb() 设置半透明颜色:

If the control supports transparent backgrounds, you can use Color.FromArgb() to set a translucent color:

button1.BackColor = Color.FromArgb(100, Color.Red);

根据您希望它如何工作,您可以改变 alpha 值(在 0 到 255 之间).

Depending on how you want this to work, you would vary the alpha value (to between 0 and 255).

这篇关于控制不透明度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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