Display color dialog and get user selection : Color Dialog « GUI Windows Form « C# / C Sharp






Display color dialog and get user selection

Display color dialog and get user selection
  using System;
  using System.Drawing;
  using System.Collections;
  using System.ComponentModel;
  using System.Windows.Forms;
  using System.Data;

  public class Test
  {
    static void Main() 
    {
        System.Windows.Forms.ColorDialog colorDlg = new System.Windows.Forms.ColorDialog();    
      colorDlg.AnyColor = true;
      colorDlg.ShowHelp = true;  

      if (colorDlg.ShowDialog() != DialogResult.Cancel)
      {
        string strARGB = colorDlg.Color.ToString();
        Console.WriteLine(strARGB);
      }

    }

  }


           
       








Related examples in the same category

1.Color Converter
2.Click on me to change the colorClick on me to change the color
3.Color Dialog and Font DialogColor Dialog and Font Dialog