G
Guest
I use a ColorDialog control to select a number of custom colours using the code segment below, I've fixed the index to 0 for the purpose of highlighting the problem.
Dim intRed As Integer
Dim intGreen As Integer
Dim intBlue As Integer
ColorDialog1.ShowDialog()
intRed = Color.FromArgb(ColorDialog1.CustomColors(0)).R
intGreen = Color.FromArgb(ColorDialog1.CustomColors(0)).G
intBlue = Color.FromArgb(ColorDialog1.CustomColors(0)).B
Panel1.BackColor = Color.FromArgb(intRed, intGreen, intBlue)
BUT, it appears that the above implementation of Color.FromArgb has got the red and blue values the wrong way around, since the above line displays a different colour to the one I selected. However, when I swap the red and blue values around (as shown below) it works correctly. Is this a bug or am I doing something wrong?
Panel1.BackColor = Color.FromArgb(intBlue, intGreen, intRed)
Many thanks.
Steve
Dim intRed As Integer
Dim intGreen As Integer
Dim intBlue As Integer
ColorDialog1.ShowDialog()
intRed = Color.FromArgb(ColorDialog1.CustomColors(0)).R
intGreen = Color.FromArgb(ColorDialog1.CustomColors(0)).G
intBlue = Color.FromArgb(ColorDialog1.CustomColors(0)).B
Panel1.BackColor = Color.FromArgb(intRed, intGreen, intBlue)
BUT, it appears that the above implementation of Color.FromArgb has got the red and blue values the wrong way around, since the above line displays a different colour to the one I selected. However, when I swap the red and blue values around (as shown below) it works correctly. Is this a bug or am I doing something wrong?
Panel1.BackColor = Color.FromArgb(intBlue, intGreen, intRed)
Many thanks.
Steve