I am working on a C# - Winforms application and attempting to set the background colour of a read-only text box like so...
txtMyBox.BackColor = Color.FromName ("Red");
This is failing with the error message...
System.ArgumentException was unhandled
Message=Control does not support transparent background colors.
Source=System.Windows.Forms
First things first; is this the right way to set the background colour for a read-only textbox? I'm doing this a lot for ordinary textboxes and it appears to work fine.
If it is, could someone help me out with what a "transparent background color" is, and why I should want one? I don't think I do; I just want the background to change colour.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…