ColorDialog With Custom Color : ColorDialog « GUI Windows Forms « C# / CSharp Tutorial






ColorDialog With Custom Color
using System;        
using System.Drawing;
using System.ComponentModel;
using System.Windows.Forms;


public class ColorDialogWithCustomColor{

    public static void Main(){
    ColorDialog dlg=new ColorDialog();
    dlg.FullOpen = true;
    // Define the first five of the custom color settings
       // 0xAARRGGBB where AA is alpha, 
                        // RR is red, 
                     // GG is green 
                     // BB is blue 
    // expressed as the hexadecimal byte equivalent
    dlg.CustomColors = new int[5]{0x00ff8040, 0x00c256fe,
               0x00aa2005, 0x0004f002, 0x002194b5};

    dlg.ShowDialog();
  }

}








23.47.ColorDialog
23.47.1.ColorDialog.FullOpen = trueColorDialog.FullOpen = true
23.47.2.ColorDialog.AllFullOpen = falseColorDialog.AllFullOpen = false
23.47.3.Set default colorSet default color
23.47.4.ColorDialog With Custom ColorColorDialog With Custom Color
23.47.5.Display Color Dialog and get the selection