K
Klaus Bonadt
I would like to retrieve Color settings, serialize them via XML and
construct the Color struct afterwards in order to use
RichTextBox.SelectionColor.
This would be easy if do not have to serialize the color, for example:
ColorDialog colorDialog1 = new ColorDialog();
// Set the initial color of the dialog to the current text color.
colorDialog1.Color = richTextBox1.SelectionColor;
// Determine if the user clicked OK in the dialog and that the color has
changed.
if(colorDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK &&
colorDialog1.Color != richTextBox1.SelectionColor)
{
// Change the selection color to the user specified color.
richTextBox1.SelectionColor = colorDialog1.Color;
}
However, I would like to store the Color settings. Therefore, I need to know
how to construct the Color struct.
Any ideas?
Klaus
construct the Color struct afterwards in order to use
RichTextBox.SelectionColor.
This would be easy if do not have to serialize the color, for example:
ColorDialog colorDialog1 = new ColorDialog();
// Set the initial color of the dialog to the current text color.
colorDialog1.Color = richTextBox1.SelectionColor;
// Determine if the user clicked OK in the dialog and that the color has
changed.
if(colorDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK &&
colorDialog1.Color != richTextBox1.SelectionColor)
{
// Change the selection color to the user specified color.
richTextBox1.SelectionColor = colorDialog1.Color;
}
However, I would like to store the Color settings. Therefore, I need to know
how to construct the Color struct.
Any ideas?
Klaus