【发布时间】:2015-03-16 11:39:34
【问题描述】:
我想在 C# 中自定义一个文本框,但遇到了问题。如果我设置
textBox1.BackColor = Color.Transparent
我收到错误:
Additional information: Control does not support transparent background colors.
我尝试在构造函数中插入
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
但没有解决任何问题。我已经安装了 Dev Express,但我不知道它是否有帮助。一些想法? 构造函数:
public Constructor()
{
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
InitializeComponent();
}
【问题讨论】:
-
C# transparency on textbox 的可能重复项
-
不是重复的,我已经看到了
-
所以你的问题是为什么我的子类文本框忽略了透明度?显示构造函数