Why am I getting “Control does not support transparent background colors”?

后端 未结 5 1716
北海茫月
北海茫月 2020-12-11 23:24

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.FromNam         


        
5条回答
  •  不思量自难忘°
    2020-12-11 23:42

    A bit late - but eventually helps this someone who - like me - found this page according to the OPs question:

    I got this error when Setting a Winforms Splitter background color which was generated by a

    Color.FromArgb(0xC9,0xD9,0xEB);
    

    The solution was to generate the Color value instead with the following helper method:

    ColorTranslator.FromHtml("#C9D9EB") 
    

    This avoids generating a transparency Information.

提交回复
热议问题