Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

How to "Convert" Color to Int ?

$
0
0

I have a button with background color and the user can change the color by clicking on the button.

I want to add the color to the CustomColor property but I don't know how to convert Color to Int.

Add my code, the unknow part is the code in the comment:

            //colorDialog.CustomColors = new int[] { buRect_FormBackColor.BackColor.ToArgb() };

            colorDialog.Color = buRect_FormBackColor.BackColor;
            if (colorDialog.ShowDialog() != DialogResult.Cancel)
            {
                style.FormBackColor = colorDialog.Color;
                buRect_FormBackColor.BackColor = style.FormBackColor;
            }

Thank you

Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>