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. How to get some special Windows colors?

How to get some special Windows colors?

Scheduled Pinned Locked Moved C#
csharptutorialquestion
7 Posts 3 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.
  • N Offline
    N Offline
    NPowDev
    wrote on last edited by
    #1

    Hello, I'm interested in how to get some special Windows colors. I'm developing a small control (derived from System.Windows.Forms.CheckBox), where I need to draw my own look. Basically, it is in a look like a flat checkbox button with some additional functionality. I tried using SystemColors and so on, but I'm getting not the same colors like the original control. I need colors like the one for shadowed or highlighted parts. I have tried SystemColors.ControlDark and SystemColors.ControlDarkDark but I'm getting the same color. The original checkbox uses some different colors. Have checked this with some screen shots. I'm using w2k with .net 2.0 and all color theme setting have been set back to the original one by MS! Does anyone know a solution, or does anyone have some tips? Best regards, NPow

    J 1 Reply Last reply
    0
    • N NPowDev

      Hello, I'm interested in how to get some special Windows colors. I'm developing a small control (derived from System.Windows.Forms.CheckBox), where I need to draw my own look. Basically, it is in a look like a flat checkbox button with some additional functionality. I tried using SystemColors and so on, but I'm getting not the same colors like the original control. I need colors like the one for shadowed or highlighted parts. I have tried SystemColors.ControlDark and SystemColors.ControlDarkDark but I'm getting the same color. The original checkbox uses some different colors. Have checked this with some screen shots. I'm using w2k with .net 2.0 and all color theme setting have been set back to the original one by MS! Does anyone know a solution, or does anyone have some tips? Best regards, NPow

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      One class you might want to look at is the System.Windows.Forms.ControlPaint class. But your best bet is to look at the theme API. This is what you'll need for true look-alike controls. The Windows theme API is exposed within the System.Windows.Forms.VisualStyles namespace in .NET v2.

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: Messianic Instrumentals (with audio) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

      E N 2 Replies Last reply
      0
      • J Judah Gabriel Himango

        One class you might want to look at is the System.Windows.Forms.ControlPaint class. But your best bet is to look at the theme API. This is what you'll need for true look-alike controls. The Windows theme API is exposed within the System.Windows.Forms.VisualStyles namespace in .NET v2.

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: Messianic Instrumentals (with audio) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

        E Offline
        E Offline
        Ennis Ray Lynch Jr
        wrote on last edited by
        #3

        nt A man said to the universe: "Sir I exist!" "However," replied the Universe, "The fact has not created in me A sense of obligation." -- Stephen Crane

        1 Reply Last reply
        0
        • J Judah Gabriel Himango

          One class you might want to look at is the System.Windows.Forms.ControlPaint class. But your best bet is to look at the theme API. This is what you'll need for true look-alike controls. The Windows theme API is exposed within the System.Windows.Forms.VisualStyles namespace in .NET v2.

          Tech, life, family, faith: Give me a visit. I'm currently blogging about: Messianic Instrumentals (with audio) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

          N Offline
          N Offline
          NPowDev
          wrote on last edited by
          #4

          Thanks for the fast replay! Well... System.Windows.Forms.VisualStyles is not a choice for me at the moment; The OS does not support them... I'm working on W2k and my control should work here too.

          Judah Himango wrote:

          One class you might want to look at is the System.Windows.Forms.ControlPaint class.

          I'm very skeptical about it. At the framework reference, they say for example on the Dark() method: ... If the specified Color is one of the SystemColors, the color is converted to a SystemColors.ControlDark color; otherwise, the color's luminosity value is decreased. ... So that is the problem, SystemColors.ControlDark or SystemColors.ControlDarkDark do not return a color as the ones that the original control use. Well, I will have to give it a try... tomorrow. :) Regards, NPow

          J 1 Reply Last reply
          0
          • N NPowDev

            Thanks for the fast replay! Well... System.Windows.Forms.VisualStyles is not a choice for me at the moment; The OS does not support them... I'm working on W2k and my control should work here too.

            Judah Himango wrote:

            One class you might want to look at is the System.Windows.Forms.ControlPaint class.

            I'm very skeptical about it. At the framework reference, they say for example on the Dark() method: ... If the specified Color is one of the SystemColors, the color is converted to a SystemColors.ControlDark color; otherwise, the color's luminosity value is decreased. ... So that is the problem, SystemColors.ControlDark or SystemColors.ControlDarkDark do not return a color as the ones that the original control use. Well, I will have to give it a try... tomorrow. :) Regards, NPow

            J Offline
            J Offline
            Judah Gabriel Himango
            wrote on last edited by
            #5

            NPow wrote:

            Well... System.Windows.Forms.VisualStyles is not a choice for me at the moment; The OS does not support them... I'm working on W2k and my control should work here too.

            Windows 2000 doesn't support VisualStyles? The MSDN docs on VisualStyleRenderer says it's supported on 2k.

            Tech, life, family, faith: Give me a visit. I'm currently blogging about: Goof around music jam with my brothers (with video) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

            N 1 Reply Last reply
            0
            • J Judah Gabriel Himango

              NPow wrote:

              Well... System.Windows.Forms.VisualStyles is not a choice for me at the moment; The OS does not support them... I'm working on W2k and my control should work here too.

              Windows 2000 doesn't support VisualStyles? The MSDN docs on VisualStyleRenderer says it's supported on 2k.

              Tech, life, family, faith: Give me a visit. I'm currently blogging about: Goof around music jam with my brothers (with video) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

              N Offline
              N Offline
              NPowDev
              wrote on last edited by
              #6

              Judah Himango wrote:

              Windows 2000 doesn't support VisualStyles? The MSDN docs on VisualStyleRenderer says it's supported on 2k.

              Where do you found that statement? :confused: Direct from the MSDN 2, there stay: [...]The VisualStyleRenderer class wraps the functionality of the visual styles (UxTheme) API from the Windows Shell portion of the Windows Platform SDK. For more information about visual styles, see "Using Windows XP Visual Styles" in the Platform SDK portion of the MSDN Library at http://msdn.microsoft.com/library. Windows XP Home Edition, Windows XP Professional x64 Edition, Windows Server 2003 Platform Note: Visual styles are supported only on these platforms. [...] All tests I have maid about it's support, deliver a false value or raised an InvalidOperation Exception! Regards, NPow -- modified at 10:10 Thursday 20th July, 2006

              J 1 Reply Last reply
              0
              • N NPowDev

                Judah Himango wrote:

                Windows 2000 doesn't support VisualStyles? The MSDN docs on VisualStyleRenderer says it's supported on 2k.

                Where do you found that statement? :confused: Direct from the MSDN 2, there stay: [...]The VisualStyleRenderer class wraps the functionality of the visual styles (UxTheme) API from the Windows Shell portion of the Windows Platform SDK. For more information about visual styles, see "Using Windows XP Visual Styles" in the Platform SDK portion of the MSDN Library at http://msdn.microsoft.com/library. Windows XP Home Edition, Windows XP Professional x64 Edition, Windows Server 2003 Platform Note: Visual styles are supported only on these platforms. [...] All tests I have maid about it's support, deliver a false value or raised an InvalidOperation Exception! Regards, NPow -- modified at 10:10 Thursday 20th July, 2006

                J Offline
                J Offline
                Judah Gabriel Himango
                wrote on last edited by
                #7

                Interesting -- the page you cite (http://msdn2.microsoft.com/en-us/library/system.windows.forms.visualstyles.visualstylerenderer.aspx) shows supported platforms as all of them, yet the documentation text says it's not supported on Win2k.

                Tech, life, family, faith: Give me a visit. I'm currently blogging about: Messianic Instrumentals (with audio) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

                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