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 / C++ / MFC
  4. Setting Font and Text Colors items of ComboBox

Setting Font and Text Colors items of ComboBox

Scheduled Pinned Locked Moved C / C++ / MFC
4 Posts 2 Posters 17 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.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    At first I thought I could set the above values in DrawItem (I have an ownerdraw combobox). The Drawitem however only gets invoked when clicking the right icon after the display I have tried OnCtlColor in the dialog (for the text color) It does get invoked but doesnt set the text color. Tried OnCreate in ComboBox for the font for that it just didn't get invoked Thanks

    F 1 Reply Last reply
    0
    • F ForNow

      At first I thought I could set the above values in DrawItem (I have an ownerdraw combobox). The Drawitem however only gets invoked when clicking the right icon after the display I have tried OnCtlColor in the dialog (for the text color) It does get invoked but doesnt set the text color. Tried OnCreate in ComboBox for the font for that it just didn't get invoked Thanks

      F Offline
      F Offline
      ForNow
      wrote on last edited by
      #2

      Presubclasswindntrolow got the font working Then I re-read remarks on CTLCOLOR seems like for a combobox the message is sent to the combobox as it is the parent to the edit control and list box However the ctlcolor for the combobox only got called twice and both times had a value CTLCOLOREDIT maybe the idea is then to set the color of the listbox in the Drawitem Thanks

      V 1 Reply Last reply
      0
      • F ForNow

        Presubclasswindntrolow got the font working Then I re-read remarks on CTLCOLOR seems like for a combobox the message is sent to the combobox as it is the parent to the edit control and list box However the ctlcolor for the combobox only got called twice and both times had a value CTLCOLOREDIT maybe the idea is then to set the color of the listbox in the Drawitem Thanks

        V Offline
        V Offline
        Victor Nijegorodov
        wrote on last edited by
        #3

        I gave yu a link to a CP article: [Re: OwnerDraw Combox - C / C++ / MFC Discussion Boards](https://www.codeproject.com/Messages/5877909/Re-OwnerDraw-Combox) Did you look at it?

        F 1 Reply Last reply
        0
        • V Victor Nijegorodov

          I gave yu a link to a CP article: [Re: OwnerDraw Combox - C / C++ / MFC Discussion Boards](https://www.codeproject.com/Messages/5877909/Re-OwnerDraw-Combox) Did you look at it?

          F Offline
          F Offline
          ForNow
          wrote on last edited by
          #4

          I downloaded it built it debug x64 and as I was stepping thru that code it got an exception it was somewhere in MFC code the call stack indicated it was from an Additem Ill go back and try to fix it up thank you

          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