Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Add Custom Color in ColorDialog

Add Custom Color in ColorDialog

Scheduled Pinned Locked Moved C#
question
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hello to All, How can i add custom color in ColorDialog. Thanks

    If you can think then I Can.

    S C 2 Replies Last reply
    0
    • L Lost User

      Hello to All, How can i add custom color in ColorDialog. Thanks

      If you can think then I Can.

      S Offline
      S Offline
      sanforjackass
      wrote on last edited by
      #2

      you mean red color for example

      EASY COME EASY GO

      L 1 Reply Last reply
      0
      • S sanforjackass

        you mean red color for example

        EASY COME EASY GO

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        No, ColorDialog box have a option of Custom Color. In these boxes we can add our selected color.It may be red or according to R,G,B.

        If you can think then I Can.

        OriginalGriffO 1 Reply Last reply
        0
        • L Lost User

          No, ColorDialog box have a option of Custom Color. In these boxes we can add our selected color.It may be red or according to R,G,B.

          If you can think then I Can.

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #4

          If it has the option, then what is your problem? Just turn the option on! Or is there more to your query?

          You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          L 1 Reply Last reply
          0
          • OriginalGriffO OriginalGriff

            If it has the option, then what is your problem? Just turn the option on! Or is there more to your query?

            You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            No Dear this option is only in GUI. my question is that is any option by using programmingly i can add custom color in Colordialog box.

            If you can think then I Can.

            OriginalGriffO 1 Reply Last reply
            0
            • L Lost User

              No Dear this option is only in GUI. my question is that is any option by using programmingly i can add custom color in Colordialog box.

              If you can think then I Can.

              OriginalGriffO Offline
              OriginalGriffO Offline
              OriginalGriff
              wrote on last edited by
              #6

              Have you tried this?

                      ColorDialog cd = new ColorDialog();
                      cd.CustomColors = new int\[\] {1, 2000, 20000, 255, 255 \* 0x100, 255 \* 0x10000}; 
                      cd.ShowDialog();
              

              You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
              "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

              L 1 Reply Last reply
              0
              • L Lost User

                Hello to All, How can i add custom color in ColorDialog. Thanks

                If you can think then I Can.

                C Offline
                C Offline
                carlecomm
                wrote on last edited by
                #7

                To create a custom color, 1. In the More Colors dialog box, click Custom... . The Color dialog box is displayed. 2 Try one of the following: a. Use the color matrix and the saturation gradient to create a color by clicking inside the matrix. Then use the saturation gradient pointer to select a saturation level. b. Enter the HSL or RGB values for the custom color. The custom color is displayed in the Color/Solid box. 3. If you want to create more colors, click Add to Custom Colors to add the color to the Custom colors palette. You can then repeat step 2 to create other colors. 4. Click OK to assign the color to the page element that you have selected on the page.

                1 Reply Last reply
                0
                • OriginalGriffO OriginalGriff

                  Have you tried this?

                          ColorDialog cd = new ColorDialog();
                          cd.CustomColors = new int\[\] {1, 2000, 20000, 255, 255 \* 0x100, 255 \* 0x10000}; 
                          cd.ShowDialog();
                  

                  You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Thank you Exactly i want it

                  If you can think then I Can.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups