Alpha transparency support in WinForms controls (TextBox vs Button) #14881
Unanswered
umanagarajan12
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I am evaluating support for transparency and alpha colors in WinForms controls and have observed inconsistent behavior between controls. Some controls appear to accept colors created with Color.FromArgb(alpha, r, g, b), while TextBox rejects the same color assignment.
Example
textBox3.BackColor = Color.FromArgb(128, 243, 243, 243);
Observed Behavior
Assigning an alpha color to TextBox.BackColor throws the following exception:
System.ArgumentException: 'Control does not support transparent background colors.'
Questions for Microsoft
All reactions