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. List control window

List control window

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
12 Posts 5 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
    Shay Harel
    wrote on last edited by
    #1

    Hi ! I am trying to use a list control inside a window, not a dialog, so I can resize it. I tried to create a class the inherit from CListCtrl and on it's instance to use the Create function: CErrReport::CErrReport(CWnd *pParent) { Create (WS_OVERLAPPEDWINDOW|WS_HSCROLL|WS_VSCROLL,CRect (20,30,200,300),pParent,1); } On the paret window I used : CErrReport *perr=new CErrReport (this); perr->ShowWindow (SW_SHOWNORMAL); But the problem is that when the window starts I can't even click on it or move it or close it, nothing..... What am I doing wrong ?????????????????/// Please help me Thank you :(

    A S I 3 Replies Last reply
    0
    • S Shay Harel

      Hi ! I am trying to use a list control inside a window, not a dialog, so I can resize it. I tried to create a class the inherit from CListCtrl and on it's instance to use the Create function: CErrReport::CErrReport(CWnd *pParent) { Create (WS_OVERLAPPEDWINDOW|WS_HSCROLL|WS_VSCROLL,CRect (20,30,200,300),pParent,1); } On the paret window I used : CErrReport *perr=new CErrReport (this); perr->ShowWindow (SW_SHOWNORMAL); But the problem is that when the window starts I can't even click on it or move it or close it, nothing..... What am I doing wrong ?????????????????/// Please help me Thank you :(

      A Offline
      A Offline
      Alberto Giannetto
      wrote on last edited by
      #2

      Why not use resizable dialogs? Alberto

      A 1 Reply Last reply
      0
      • S Shay Harel

        Hi ! I am trying to use a list control inside a window, not a dialog, so I can resize it. I tried to create a class the inherit from CListCtrl and on it's instance to use the Create function: CErrReport::CErrReport(CWnd *pParent) { Create (WS_OVERLAPPEDWINDOW|WS_HSCROLL|WS_VSCROLL,CRect (20,30,200,300),pParent,1); } On the paret window I used : CErrReport *perr=new CErrReport (this); perr->ShowWindow (SW_SHOWNORMAL); But the problem is that when the window starts I can't even click on it or move it or close it, nothing..... What am I doing wrong ?????????????????/// Please help me Thank you :(

        S Offline
        S Offline
        Steen Krogsgaard
        wrote on last edited by
        #3

        Shouldn't it be created using the WS_CHILD style? All the controls are supposted to be child windows. Just an idea. Cheers Steen. "To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"

        S 1 Reply Last reply
        0
        • A Alberto Giannetto

          Why not use resizable dialogs? Alberto

          A Offline
          A Offline
          Anonymous
          wrote on last edited by
          #4

          If I use a resizable dialog, then the dialog itself is resized but the control size is fixed, no ? If I create a dialog based application, and I click on the maximize button, all the control remian in the original size they were created, is there a way to expand them to the size of the whole dialog frame ? Thank you Shay

          A 1 Reply Last reply
          0
          • S Steen Krogsgaard

            Shouldn't it be created using the WS_CHILD style? All the controls are supposted to be child windows. Just an idea. Cheers Steen. "To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"

            S Offline
            S Offline
            Shay Harel
            wrote on last edited by
            #5

            Well, I tried to OR inot the style WS_CHILD and it did not help.... Thank you...

            S 1 Reply Last reply
            0
            • A Anonymous

              If I use a resizable dialog, then the dialog itself is resized but the control size is fixed, no ? If I create a dialog based application, and I click on the maximize button, all the control remian in the original size they were created, is there a way to expand them to the size of the whole dialog frame ? Thank you Shay

              A Offline
              A Offline
              Alberto Giannetto
              wrote on last edited by
              #6

              Anonymous wrote: If I use a resizable dialog, then the dialog itself is resized but the control size is fixed, no ? If I create a dialog based application, and I click on the maximize button, all the control remian in the original size they were created, is there a way to expand them to the size of the whole dialog frame ? You should be able to intercept the WM_SIZE and then, for each control in the window, call SetWindowPos or something like that. The WM_SIZE gets called with the new size as parameters, so you can redraw your controls or child window accordingly. Albi

              1 Reply Last reply
              0
              • S Steen Krogsgaard

                How about message reflection? I can't remember if it's nescessary to make the control work properly. Cheers Steen. "To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"

                S Offline
                S Offline
                Shay Harel
                wrote on last edited by
                #7

                what is message reflection ?

                S 1 Reply Last reply
                0
                • S Shay Harel

                  Well, I tried to OR inot the style WS_CHILD and it did not help.... Thank you...

                  S Offline
                  S Offline
                  Steen Krogsgaard
                  wrote on last edited by
                  #8

                  How about message reflection? I can't remember if it's nescessary to make the control work properly. Cheers Steen. "To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"

                  S 1 Reply Last reply
                  0
                  • S Shay Harel

                    what is message reflection ?

                    S Offline
                    S Offline
                    Steen Krogsgaard
                    wrote on last edited by
                    #9

                    Look at TN062 in MSDN. Sorry for not elaborating, but I really have to get home now (it's almost 5 pm in Denmark). Cheers Steen. "To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"

                    I 1 Reply Last reply
                    0
                    • S Steen Krogsgaard

                      Look at TN062 in MSDN. Sorry for not elaborating, but I really have to get home now (it's almost 5 pm in Denmark). Cheers Steen. "To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"

                      I Offline
                      I Offline
                      Idefix
                      wrote on last edited by
                      #10

                      I think the style is wrong. WS_CHILD|WS_VISIBLE| .... don't WS_OVERLAPPEDWINDOW (WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX...)

                      1 Reply Last reply
                      0
                      • S Shay Harel

                        Hi ! I am trying to use a list control inside a window, not a dialog, so I can resize it. I tried to create a class the inherit from CListCtrl and on it's instance to use the Create function: CErrReport::CErrReport(CWnd *pParent) { Create (WS_OVERLAPPEDWINDOW|WS_HSCROLL|WS_VSCROLL,CRect (20,30,200,300),pParent,1); } On the paret window I used : CErrReport *perr=new CErrReport (this); perr->ShowWindow (SW_SHOWNORMAL); But the problem is that when the window starts I can't even click on it or move it or close it, nothing..... What am I doing wrong ?????????????????/// Please help me Thank you :(

                        I Offline
                        I Offline
                        Idefix
                        wrote on last edited by
                        #11

                        suggestion CErrReportListCtrl:public CListCtrl { }; CErrReport:public CWnd { private: CErrReportListCtrl m_ListCtrl; public: CErrReport(CWnd* pParent,CRect& r=CRect(0,0,200,200)) { Create(pParent,r); } void Create(CWnd* pParent,CRect& r) { Create(WS_OVERLAPPED|..,...,r,pParent,..); m_ListCtrl.Create(WS_CHILD|WS_VISIBLE|..,.....,this,1); } void OnSize(nType, cx, cy) { //Maybe if(GetSafeWnd()!=NULL) m_ListCtrl.MoveWindow (0, 0, cx, cy); } }; CErrReport *p= new CErrReport(this); The Listctrl is nested in the CWnd

                        S 1 Reply Last reply
                        0
                        • I Idefix

                          suggestion CErrReportListCtrl:public CListCtrl { }; CErrReport:public CWnd { private: CErrReportListCtrl m_ListCtrl; public: CErrReport(CWnd* pParent,CRect& r=CRect(0,0,200,200)) { Create(pParent,r); } void Create(CWnd* pParent,CRect& r) { Create(WS_OVERLAPPED|..,...,r,pParent,..); m_ListCtrl.Create(WS_CHILD|WS_VISIBLE|..,.....,this,1); } void OnSize(nType, cx, cy) { //Maybe if(GetSafeWnd()!=NULL) m_ListCtrl.MoveWindow (0, 0, cx, cy); } }; CErrReport *p= new CErrReport(this); The Listctrl is nested in the CWnd

                          S Offline
                          S Offline
                          Shay Harel
                          wrote on last edited by
                          #12

                          I will try this one, it looks like it's going to work. I found a similar solution in a book but it was too complicated, yours looks better. Thank you. Shay

                          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