how to disable vertical and horizontal scrollbar in a FormView class
-
Hi I am using a multidocument application. CMultiDocTemplate* pDocTemplate_Digi; pDocTemplate_Digi = new CMultiDocTemplate( IDR_DIGITAL, RUNTIME_CLASS(CDDRUDoc), RUNTIME_CLASS(CChildFrame), // custom MDI child frame RUNTIME_CLASS(CSuperGrid1View)); my view CSuperGrid1View is inherited from CFormview. I want to disable the scroll bars that is coming default in my view. BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs] cs.style &= ~WS_EX_RIGHTSCROLLBAR; cs.style &= ~WS_EX_LEFTSCROLLBAR ; if( !CMDIChildWnd::PreCreateWindow(cs) ) return FALSE; return TRUE; } I did the same in CSuperGrid1View::PreCreateWindow(..) But it is not disabling.Can anybody help me please. Regards Deepu
-
Hi I am using a multidocument application. CMultiDocTemplate* pDocTemplate_Digi; pDocTemplate_Digi = new CMultiDocTemplate( IDR_DIGITAL, RUNTIME_CLASS(CDDRUDoc), RUNTIME_CLASS(CChildFrame), // custom MDI child frame RUNTIME_CLASS(CSuperGrid1View)); my view CSuperGrid1View is inherited from CFormview. I want to disable the scroll bars that is coming default in my view. BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs] cs.style &= ~WS_EX_RIGHTSCROLLBAR; cs.style &= ~WS_EX_LEFTSCROLLBAR ; if( !CMDIChildWnd::PreCreateWindow(cs) ) return FALSE; return TRUE; } I did the same in CSuperGrid1View::PreCreateWindow(..) But it is not disabling.Can anybody help me please. Regards Deepu
A form view derived class will automatically show its scroll bars if the client area assigned to it is smaller than the dialog resource used to create the form with. This is so that the controls can be scrolled into view. To remove the scroll bars you need to handle the WM_SIZE message for your form and call SetScaleToFitSize(cx, cy) (function name from memory with no docs available, may not be precise) function which is part of CScrollView, a base class of CFormView. You may also need to resize/reposition controls on your form so make full use of the available space.
If you vote me down, my score will only get lower