ColorTranslator.FromOle(0x8000000f) number too large

1

I'm trying to update an old VB6 program and I came across this line

frmMain.Command1(X).BackColor = &H8000000F

When trying to convert this to C# I came up with

this.Command1[X].BackColor = System.Drawing.ColorTranslator.FromOle(0x8000000f);

This doesn't seem to work as the hex number is too large for .FromOle as it takes an int, but this number is too large for an int. Do you have any suggestions on other ways that I can do this or get around this?

Thanks

c#
colors
vb6
asked on Stack Overflow Aug 19, 2016 by Shivers McGee • edited Aug 19, 2016 by Raktim Biswas

1 Answer

2

&H8000000F is the button face color, and in C# :

this.Command1[X].BackColor = SystemColors.ButtonFace
answered on Stack Overflow Aug 19, 2016 by Shachaf.Gortler

User contributions licensed under CC BY-SA 3.0