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. How to Insert a CButton into a CListControl ? [modified]

How to Insert a CButton into a CListControl ? [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelptutorialcareer
3 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.
  • E Offline
    E Offline
    erajsri
    wrote on last edited by
    #1

    Well I got this need to have a CListControl that should have a button in a given column ( Not all columns ). When this button is clicked I should catch the event and throw some actions, such as opening a dialog etc. My question is how do I insert a CButton to a CListCtrl ? I tried CRect r; GetSubItemRect(r) and creating the button in this rect. But the problem is that the button doesnt get erased / painted nicely when the columns are resized. Please tell me how I could hav the Button resize / reposition when the List Control or its columns are resized. ... Or if there are any other easy ways to get the job done ! thanx a lot :) -- modified at 3:26 Thursday 25th January, 2007

    P H 2 Replies Last reply
    0
    • E erajsri

      Well I got this need to have a CListControl that should have a button in a given column ( Not all columns ). When this button is clicked I should catch the event and throw some actions, such as opening a dialog etc. My question is how do I insert a CButton to a CListCtrl ? I tried CRect r; GetSubItemRect(r) and creating the button in this rect. But the problem is that the button doesnt get erased / painted nicely when the columns are resized. Please tell me how I could hav the Button resize / reposition when the List Control or its columns are resized. ... Or if there are any other easy ways to get the job done ! thanx a lot :) -- modified at 3:26 Thursday 25th January, 2007

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      Have a look at this[^] article.

      Prasad Notifier using ATL | Operator new[],delete[][^]

      1 Reply Last reply
      0
      • E erajsri

        Well I got this need to have a CListControl that should have a button in a given column ( Not all columns ). When this button is clicked I should catch the event and throw some actions, such as opening a dialog etc. My question is how do I insert a CButton to a CListCtrl ? I tried CRect r; GetSubItemRect(r) and creating the button in this rect. But the problem is that the button doesnt get erased / painted nicely when the columns are resized. Please tell me how I could hav the Button resize / reposition when the List Control or its columns are resized. ... Or if there are any other easy ways to get the job done ! thanx a lot :) -- modified at 3:26 Thursday 25th January, 2007

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        Here is I saw examples of listctrl of Chris Maunder and other programmers see Listctrl section on the MFC controls


        WhiteSky


        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