title: Converting RGB to ARGB
body: <p>I'm trying to emulate the Color.ToArgb() Net function in VB6.</p>
  
  <p>For my attempts I have chosen the color Red.</p>
  
  <p>In .NET I'm getting the result </p>
  
  <pre><code>Color.Red.ToArgb() = -65536
  </code></pre>
  
  <p>However, I'm not able to reproduce this in VB6.</p>
  
  <p>My function RGBToARGB(vbRed, 255) returns -16776961 </p>
  
  <pre><code>Public Function RGBToARGB(ByVal uColor As Long, ByVal uAlpha As Integer) As Long
  
      Dim newColor As Long
  
      ' To add an Alpha channel to the RGB, simply
      If uAlpha &gt; 127 Then
         newColor = uColor Or ((uAlpha - 128) * &amp;H1000000 Or &amp;H80000000)
      Else
         newColor = uColor Or (uAlpha * &amp;H1000000)
      End If
  
      RGBToARGB = newColor
  
  End Function
  </code></pre>
  
  <p>Does anybody see what I'm doing wrong / different than the .NET version?</p>