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. Drawing on a listview, combobox to big, and how do I create a flat CButton?

Drawing on a listview, combobox to big, and how do I create a flat CButton?

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphics
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.
  • M Offline
    M Offline
    mhowes
    wrote on last edited by
    #1

    I'm trying to draw control programmatically in the 1st sub item of a listview row when the user sets the focus to that item. I have a handful of questions. Currently I'm doing this in the OnItemChanged and seeing if the items uNewState is SELECTED. Is this the best place to do this? Seems to work. Next, I use GetSubItemRect in combination with pNMLV-iItem to get the rect of the subitem I want to put the control over. This seem to work ok...except..with a combobox. GetListCtrl().GetSubItemRect(pNMLV->iItem,1,LVIR_BOUNDS,itemRect); CComboBox *pCombo = new CComboBox; pCombo->Create(WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_CLIPCHILDREN, itemRect, this,190); The combobox shows up to big. It must have a minmum size or something? when I do the same thing with CEdit and CButton they work perfect. Also isn't the size difference in a combobox's CRect top and bottom the amount the combbox will drop down? Also, is there a way to create the combobox without a boarder so it will show up over the subitem better? Is there a style to make CButton flat? thanks mike

    C 1 Reply Last reply
    0
    • M mhowes

      I'm trying to draw control programmatically in the 1st sub item of a listview row when the user sets the focus to that item. I have a handful of questions. Currently I'm doing this in the OnItemChanged and seeing if the items uNewState is SELECTED. Is this the best place to do this? Seems to work. Next, I use GetSubItemRect in combination with pNMLV-iItem to get the rect of the subitem I want to put the control over. This seem to work ok...except..with a combobox. GetListCtrl().GetSubItemRect(pNMLV->iItem,1,LVIR_BOUNDS,itemRect); CComboBox *pCombo = new CComboBox; pCombo->Create(WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_CLIPCHILDREN, itemRect, this,190); The combobox shows up to big. It must have a minmum size or something? when I do the same thing with CEdit and CButton they work perfect. Also isn't the size difference in a combobox's CRect top and bottom the amount the combbox will drop down? Also, is there a way to create the combobox without a boarder so it will show up over the subitem better? Is there a style to make CButton flat? thanks mike

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I believe you can make the buttons flat in the resource editor. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

      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