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. Help: How to autofit CListCtrl's background?

Help: How to autofit CListCtrl's background?

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

    My dialog is resizable with a list control, and the list control's rect is the whole of dialog's client rect, call CListCtrl::SetBkImage to enable background. My question is how to autofit(stretch) background with the dialog when resizing? Thanks.

    A 1 Reply Last reply
    0
    • S Symfund

      My dialog is resizable with a list control, and the list control's rect is the whole of dialog's client rect, call CListCtrl::SetBkImage to enable background. My question is how to autofit(stretch) background with the dialog when resizing? Thanks.

      A Offline
      A Offline
      Ahmed Charfeddine
      wrote on last edited by
      #2

      What if your try call ::SetBkImage again when the OnSize member is triggered ?

      Easy Profiler : Now open source ! http://www.codeproject.com/KB/cpp/easyprofiler.aspx

      S 1 Reply Last reply
      0
      • A Ahmed Charfeddine

        What if your try call ::SetBkImage again when the OnSize member is triggered ?

        Easy Profiler : Now open source ! http://www.codeproject.com/KB/cpp/easyprofiler.aspx

        S Offline
        S Offline
        Symfund
        wrote on last edited by
        #3

        void CMyDlg::OnSize(UINT nType, int cx, int cy) { CDialog::OnSize(nType, cx, cy); // TODO: Add your message handler code here if (IsWindow(m_ListCtrl.m_hWnd)) { CRect rect; GetClientRect(rect); m_ListCtrl.MoveWindow(rect); m_ListCtrl.SetBkImage(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BKIMAGE))); } } problem still unresolved, autofit(stretch) no effect! Thanks!

        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