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 disable vertical and horizontal scrollbar in a FormView class

how to disable vertical and horizontal scrollbar in a FormView class

Scheduled Pinned Locked Moved C / C++ / MFC
wpfhelptutorial
2 Posts 2 Posters 2 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.
  • D Offline
    D Offline
    Deepu Antony
    wrote on last edited by
    #1

    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

    R 1 Reply Last reply
    0
    • D Deepu Antony

      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

      R Offline
      R Offline
      Roger Allen
      wrote on last edited by
      #2

      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

      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