List control window
-
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 :(Why not use resizable dialogs? Alberto
-
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 :(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"
-
Why not use resizable dialogs? Alberto
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
-
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"
Well, I tried to OR inot the style WS_CHILD and it did not help.... Thank you...
-
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
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
-
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"
what is message reflection ?
-
Well, I tried to OR inot the style WS_CHILD and it did not help.... Thank you...
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"
-
what is message reflection ?
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"
-
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"
-
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 :(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
-
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
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