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. ListCtrl

ListCtrl

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

    I have a few questions on list ctrl if anyone has touched upon these details. I've tried the main page which focuses on the list ctrl without luck. 1) is it possible to dynamically change the header column width of the last column so that when a scrollbar appears or disappears I can have the column realigned to fit so I don't create a horizontal scroll bar? 2) Also, I've noticed DevStudio has listctrls where the last column cannot be resized. Is this a part of the listctrl functionality? Thanks for the help! Chris

    L 1 Reply Last reply
    0
    • C Chris Klecker

      I have a few questions on list ctrl if anyone has touched upon these details. I've tried the main page which focuses on the list ctrl without luck. 1) is it possible to dynamically change the header column width of the last column so that when a scrollbar appears or disappears I can have the column realigned to fit so I don't create a horizontal scroll bar? 2) Also, I've noticed DevStudio has listctrls where the last column cannot be resized. Is this a part of the listctrl functionality? Thanks for the help! Chris

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Chris I am not a ListCtrl expert but have been playing with them a bit lately, hope this information is helpful. 1. Get the width of the last column subtract the width of the scrollbar and set column width to result.

      int nWidth = m_ListCtrl.GetColumnWidth(nLastCol);
      nWidth -= SomeFunctionToGetWidthOfScrollBar(); //Get real function yourself
      m_cCustomerList.SetColumnWidth((nLastCol), nWidth);

      You would need to use this code when you have added a row that goes beyond the visible portion of the ListCtrl. 2. As far as I know all ListCtrls by default have the last column (all columns) resizeable. Grab the right side of right most header and drag out beyond edge of ListCtrl. Michael Martin Pegasystems Pty Ltd Australia martm@pegasystems.com +61 413-004-018 "Don't belong. Never join. Think for yourself. Peace" - Victor Stone

      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