title: Control does not support transparent background colors. VB.NET
body: <p>I've written the following to load the backcolor from an ini file:</p>
  
  <pre><code>Form1.elect1Label.BackColor = decipherColor(ReadIni.ReadIni("save.ini", "Default", "bg"))
  End Sub
  
  Function decipherColor(ByVal undecipheredColor As String) As Color
      Dim deciphered As String = undecipheredColor.Split(New Char() {"[", "]"})(1)
      decipherColor = System.Drawing.Color.FromName(deciphered)
      Console.WriteLine(System.Drawing.Color.FromName(deciphered))
  End Function
  </code></pre>
  
  <p>Note that <code>ReadIni.ReadIni("save.ini', "Default", "bg")</code> = <code>Color [A=255 R=255 G=255 B=254]</code>. The decipherColor function is used to convert colors of the form <code>Color [RED]</code> to something that a control will recognise, so instead of doing <code>control.backcolor = Color.red</code>, I can do <code>control.backcolor = decipherColor("Color [RED]")</code>.</p>
  
  <p>This function works fine, and <code>Form1.elect1Label.BackColor</code> becomes <code>255,255,255,254</code> (which is form1's transparencyKey) but it will only do this under Windows 7. When running the code under Windows 10, I receive </p>
  
  <blockquote>
    <p>Control does not support transparent background colors.</p>
  </blockquote>
  
  <p>I have found this as a solution: <code>this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);</code>, however <code>.SetStyle</code> is not an available option for <code>Form1.elect1Label</code>. This makes me think that <code>.SetStyle</code> is <code>c++</code> code, not <code>vb.net</code>.</p>
  
  <p>Can anyone help me resolve this error under Windows 10?</p>