T
Tony Lin
I am having trouble using the CustomColors property in the ColorDialog control.
I have created an int array from ARGB values and assigned it to the CustomColors property of my ColorDialog control. AllowFullOpen has been set to true.
Yet when I execute ShowDialog, the boxes specified for custom colors display only black.
Here's my code:
int[] customColors = new int[4];
customColors[0] = Color.Beige.ToArgb();
customColors[1] = Color.CadetBlue.ToArgb();
customColors[2] = Color.Chocolate.ToArgb();
customColors[3] = Color.DeepPink.ToArgb();
this.colorDialog.AllowFullOpen = true;
this.colorDialog.AnyColor = true;
this.colorDialog.CustomColors = customColors;
DialogResult dr = this.colorDialog.ShowDialog();
The ColorDialog displays 4 black squares and 12 white squares in the Custom Colors section.
What am I doing wrong here?
Tony Lin
Fremont, CA
I have created an int array from ARGB values and assigned it to the CustomColors property of my ColorDialog control. AllowFullOpen has been set to true.
Yet when I execute ShowDialog, the boxes specified for custom colors display only black.
Here's my code:
int[] customColors = new int[4];
customColors[0] = Color.Beige.ToArgb();
customColors[1] = Color.CadetBlue.ToArgb();
customColors[2] = Color.Chocolate.ToArgb();
customColors[3] = Color.DeepPink.ToArgb();
this.colorDialog.AllowFullOpen = true;
this.colorDialog.AnyColor = true;
this.colorDialog.CustomColors = customColors;
DialogResult dr = this.colorDialog.ShowDialog();
The ColorDialog displays 4 black squares and 12 white squares in the Custom Colors section.
What am I doing wrong here?
Tony Lin
Fremont, CA