.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
343 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
i tried to translate the textbox back color to hex code but it gives incorrect result. how can i get a correct result please help!!!!
Color myColor2 = textBox27.BackColor;
int nColorWin2 = ColorTranslator.ToWin32(myColor2);
textBox27.Text = string.Format("{0:X6}", nColorWin2);
when the background color is red it gives 0000ff and when it is blue it gives ff0000
If you check the docs, those are the correct values.
https://learn.microsoft.com/en-us/windows/win32/gdi/colorref
Note: this because windows is little endian