سلام دوست عزیز .
از کد زیر استفاده کن :



private static String HexConverter(System.Drawing.Color c)
{
String rtn = String.Empty;
try
{
rtn = "#" + c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2");
}
catch (Exception ex) { }
return rtn;
}


private void button5_Click(object sender, EventArgs e)
{
colorDialog1.ShowDialog();
MessageBox.Show(HexConverter(colorDialog1.Color));
}