Pick a color with ColorDialog

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
C# Code Snippets

C# Source Code Bank

See also …
edit

This C# code snippet displays the ColorDialog dialog box in order to select a color.

using System.Windows.Forms;
...
ColorDialog colorDialog = new ColorDialog(); 
if ( colorDialog.ShowDialog() != DialogResult.Cancel )
{ 
   textBox.ForeColor = colorDialog.Color;
}

Personal tools