It's just the standard colorpicker, but I used the ColorDialog class.
Code:
private void menuItemColorPicker_Click(System.Object sender, System.EventArgs e)
{
System.Drawing.Font currentFont = richTextBoxData.SelectionFont;
ColorDialog MyDialog = new ColorDialog();
// Keeps the user from selecting a custom color.
MyDialog.AllowFullOpen = true ;
// Allows the user to get help. (The default is false.)
MyDialog.ShowHelp = true ;
// Sets the initial color select to the current text color,
// so that if the user cancels out, the original color is restored.
MyDialog.Color = this.textBoxvbCodeConverted.ForeColor ;
// Open color selection dialog box
MyDialog.ShowDialog();
// Change text color in RTF text box
this.richTextBoxData.SelectionColor =
Color.FromArgb((int)MyDialog.Color.R,
(int)MyDialog.Color.G,
(int)MyDialog.Color.B);
}
it's a cool dialog indeed and the equivalent is using Color.<color-name>
just wondering, what's the base class does Color belongs to?
end------------------------------
Programmers aren't born, but are made from hardwork, effort and time.
To be a good one, requires more effort and hardwork.
Therefore N quality programmer = (N*hardwork)+(N*effort)+(N*time)
Its a struct...
belongs to system.drawing namespace...
I found another way out!
you add a combo and on click open a Tabview and fill those tabs with colors...
and when user selects a color... set the combo back color to that color...
not the best solution tho'
If you think you CAN, you can, If you think you CAN'T, you are probably right.
Have some nice Idea to share? Write an Article Online or Email to us and You may WIN a Technical Book from CG.
Color comes in 3 dimensions, red, green, and blue. Hence, color is best visualized in 3d. It allows for a common sense visualization throughout the spectrum.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.