CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Andy Tacker is offline More than "Just Another Member"
    Join Date
    Jun 2001
    Location
    55°50' N 37°39' E
    Posts
    1,503

    C# Color Picker!

    Hey Folkz!
    did u ever noticed a pretty good Color Picker Dialog in .NET?
    the one in Property window?

    is it or something equivalent available?
    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.

  2. #2
    Join Date
    Jul 2002
    Location
    Seattle Area, WA
    Posts
    241
    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);
            }

  3. #3
    Andy Tacker is offline More than "Just Another Member"
    Join Date
    Jun 2001
    Location
    55°50' N 37°39' E
    Posts
    1,503

    Color Picker

    nuh nuh! Termite....

    that opens a new Dialog window...

    what I am saying is different...

    take a look at the pic...
    Attached Images Attached Images  
    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.

  4. #4
    Join Date
    Oct 2002
    Location
    Torture chamber
    Posts
    132
    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)

  5. #5
    Andy Tacker is offline More than "Just Another Member"
    Join Date
    Jun 2001
    Location
    55°50' N 37°39' E
    Posts
    1,503

    Color Picker

    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.

  6. #6
    Join Date
    Jul 2002
    Location
    Seattle Area, WA
    Posts
    241
    Andy_Tacker, I don't know if its "exactly" what your looking for, but this might be close.

    http://www.codeproject.com/cs/miscct...olorpicker.asp

  7. #7
    Andy Tacker is offline More than "Just Another Member"
    Join Date
    Jun 2001
    Location
    55°50' N 37°39' E
    Posts
    1,503

    Color Picker

    Yeah Termite!
    Danke...
    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.

  8. #8
    Join Date
    Apr 2013
    Posts
    1

    Re: Color Picker

    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.
    Name:  colorpicker50.jpg
Views: 6560
Size:  44.4 KB
    http://www.technologicalutopia.com/colorpicker.htm

  9. #9
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: C# Color Picker!

    OK, this thread is 10 years old!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured