CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    9

    To remove Vertical & Horizontal Scroll Bars of a Form View

    I have created a view CMyView derived from CFormView. I have added the following code in init instance.
    pDocTemplate1 = new CMultiDocTemplate(
    IDR_MYVIEW,
    RUNTIME_CLASS(CMyDoc),
    RUNTIME_CLASS(CChildFrame), // custom MDI child frame
    RUNTIME_CLASS(CMyView));

    AddDocTemplate(pDocTemplate1);

    This gives me a FormView. When I resize the view I get Horizontal & Vertical Scroll Bars. To avoid the Scroll Bars I have also used

    GetParentFrame()->RecalcLayout();
    ResizeParentToFit(FALSE);

    in OnInitialUpdate() of the view class. By using this I will not get the scroll bars initially but the scroll bars appear when I resize the view (reduce the view).
    I have also tried to modify the styles in PreCreate Window. But the scroll bars appear when I reduce the view. Is there any way to remove the scroll bars at any instant
    Thanx
    Adarsh S


  2. #2
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: To remove Vertical & Horizontal Scroll Bars of a Form View

    They appear because the page size, as known by the system, is larger than the actual window size. CFormView is derived from CScrollView, which maintains this page size.

    You could try calling SetScrollSizes() in OnInitialUpdate() with a really small page size, say (1, 1). If the window ever gets that small, you won't be able to see the scroll bars anyway! This should cure it.



    --
    Jason Teagle
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured