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. WPF
  4. [SOLVED] WPF Combobox background color

[SOLVED] WPF Combobox background color

Scheduled Pinned Locked Moved WPF
csharpwpfhelpquestion
8 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.
  • S Offline
    S Offline
    Saksida Bojan
    wrote on last edited by
    #1

    Hello, I know this is a silly question but i am stunned by this. Among controls that I use like DecimalUpDown (From WPF toolkit), textboxes and comboboxes. For all controls that are required to be filled, I have set the background color to LightYellow. I am not so successful, because i am failing to applay to combobox. No matter what background property is, Combo box ignores/overrides it. I do not wan't to change any apperances of any ComboBoxItems. Also Since i need it on Windows XP, my Framework target is 4.0 Any help is appreciated.

    M A 2 Replies Last reply
    0
    • S Saksida Bojan

      Hello, I know this is a silly question but i am stunned by this. Among controls that I use like DecimalUpDown (From WPF toolkit), textboxes and comboboxes. For all controls that are required to be filled, I have set the background color to LightYellow. I am not so successful, because i am failing to applay to combobox. No matter what background property is, Combo box ignores/overrides it. I do not wan't to change any apperances of any ComboBoxItems. Also Since i need it on Windows XP, my Framework target is 4.0 Any help is appreciated.

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      I don't have an answer but by entering your question into google it seems to have been answered many times, including a tip[^] here on CP.

      Never underestimate the power of human stupidity RAH

      S 1 Reply Last reply
      0
      • S Saksida Bojan

        Hello, I know this is a silly question but i am stunned by this. Among controls that I use like DecimalUpDown (From WPF toolkit), textboxes and comboboxes. For all controls that are required to be filled, I have set the background color to LightYellow. I am not so successful, because i am failing to applay to combobox. No matter what background property is, Combo box ignores/overrides it. I do not wan't to change any apperances of any ComboBoxItems. Also Since i need it on Windows XP, my Framework target is 4.0 Any help is appreciated.

        A Offline
        A Offline
        Abhinav S
        wrote on last edited by
        #3

        Check if someone has already reported this issue on codeplex. Could be an issue. You could first try setting the back color via the view model though.

        Apps - Color Analyzer | Arctic | XKCD | Sound Meter | Speed Dial

        S 1 Reply Last reply
        0
        • M Mycroft Holmes

          I don't have an answer but by entering your question into google it seems to have been answered many times, including a tip[^] here on CP.

          Never underestimate the power of human stupidity RAH

          S Offline
          S Offline
          Saksida Bojan
          wrote on last edited by
          #4

          On google all i could find how to change drop down box when i click on combo box. Same goes for that link on CP. And i do not need that. I wanted a backgroud color changed directly on combobox and not on the drop down list. Upon further investigation by WPF inspecotrs I found that there is a specific background property on the child visual tree

          ComboBox
          Grid(templateRoot)
          Popup (PART_Popup)
          ToggleButton (toggleButton)
          Border (templateRoot)
          Border (splitBorder)
          Path (Arrow)
          ContentPresenter (contentPresenter)
          TextBlock

          I Have to change templateRoot background property. But i do not know how. I am noob at WPF

          M 1 Reply Last reply
          0
          • A Abhinav S

            Check if someone has already reported this issue on codeplex. Could be an issue. You could first try setting the back color via the view model though.

            Apps - Color Analyzer | Arctic | XKCD | Sound Meter | Speed Dial

            S Offline
            S Offline
            Saksida Bojan
            wrote on last edited by
            #5

            Not an issue. I also found out what to change with WPF inspector. But i do not know how. I replied to Mycroft Holmes with detail on what to change.

            A 1 Reply Last reply
            0
            • S Saksida Bojan

              On google all i could find how to change drop down box when i click on combo box. Same goes for that link on CP. And i do not need that. I wanted a backgroud color changed directly on combobox and not on the drop down list. Upon further investigation by WPF inspecotrs I found that there is a specific background property on the child visual tree

              ComboBox
              Grid(templateRoot)
              Popup (PART_Popup)
              ToggleButton (toggleButton)
              Border (templateRoot)
              Border (splitBorder)
              Path (Arrow)
              ContentPresenter (contentPresenter)
              TextBlock

              I Have to change templateRoot background property. But i do not know how. I am noob at WPF

              M Offline
              M Offline
              Mycroft Holmes
              wrote on last edited by
              #6

              Now you are beyond where I have ventured, especially as I work in Silverlight but I believe you need to completely restyle the combo to get what you want. Some use Expression Blend that will allow you to grab the controls style and fiddle with it, not something I would contemplate doing. I'm a great believer in battleshit grey and would never get hung up about the colour of an objects styling.

              Never underestimate the power of human stupidity RAH

              S 1 Reply Last reply
              0
              • M Mycroft Holmes

                Now you are beyond where I have ventured, especially as I work in Silverlight but I believe you need to completely restyle the combo to get what you want. Some use Expression Blend that will allow you to grab the controls style and fiddle with it, not something I would contemplate doing. I'm a great believer in battleshit grey and would never get hung up about the colour of an objects styling.

                Never underestimate the power of human stupidity RAH

                S Offline
                S Offline
                Saksida Bojan
                wrote on last edited by
                #7

                I was searching for a tool that is capable extracting Styles/Theme. I know it exsist, because i had it a few years ago. I tried VS2012 And Blend. What i noticed is that when using create a copy of style is not a perfect. I am using it on Windows 8 and border has sharp edges, and when applying a copy of a style, my controls border get rounded. On top of all when i creadet a copy, my background property took an effect i wanted it to do in the first place, without modifiying style??? I was realy suprised by this. I got it working. Thanks for sugestion.

                1 Reply Last reply
                0
                • S Saksida Bojan

                  Not an issue. I also found out what to change with WPF inspector. But i do not know how. I replied to Mycroft Holmes with detail on what to change.

                  A Offline
                  A Offline
                  Abhinav S
                  wrote on last edited by
                  #8

                  I have been able to locate styles for a number of controls on msdn. You can give it a try next time onwards. The toolkit is opensource, so you could get the styles directly via code.

                  Apps - Color Analyzer | Arctic | XKCD | Sound Meter | Speed Dial

                  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