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. dotted rectangle is not being cleared if any empty string added in MFC comboboc

dotted rectangle is not being cleared if any empty string added in MFC comboboc

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
2 Posts 2 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.
  • A Offline
    A Offline
    Amrit Agr
    wrote on last edited by
    #1

    Hi Freinds, I have combobox control in my mfc application. Here I am adding an item with an empty string and 2 more item with some txt. if i am navigating through the items, if empty string get selected, it draws a dotted boundary, but when other item is getting selected, dotted boundary of empty string is not getting cleared. So basically I can see 2 items selected at the same time. please help me out. Regards, Amrit

    L 1 Reply Last reply
    0
    • A Amrit Agr

      Hi Freinds, I have combobox control in my mfc application. Here I am adding an item with an empty string and 2 more item with some txt. if i am navigating through the items, if empty string get selected, it draws a dotted boundary, but when other item is getting selected, dotted boundary of empty string is not getting cleared. So basically I can see 2 items selected at the same time. please help me out. Regards, Amrit

      L Offline
      L Offline
      leon de boer
      wrote on last edited by
      #2

      You could just intercept the DrawItem call and for any empty string simply clear the lpDrawItemStruct->rcRect manually and then pass all the calls thru to the normal drawitem. lpDrawItemStruct has everything you need to know what to draw lpDrawItemStruct->itemID it the string number lpDrawItemStruct->itemState & ODS_SELECTED will tell give you if it is selected or not. lpDrawItemStruct->rcRect is the area to draw in

      In vino veritas

      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