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

    Scroll Bars on FormView initialization

    I'm adding controls dynamically into a formview SDI. When i add a control (during runtime) with a CRect that's outside of the window frame, it is drawn, but no scrollbar is present. In order to see it you have to resize the frame to make the CRect visible. I'm creating these controls in the CSDIView class within the OnDraw() method. Is there another method that i can create the controls in in order for it to recognize the position of the out of view control and make the scrollbar? Or is there a way to manually create the scrollbar and have it scroll the formview to make the control visible? Any help would be great.



  2. #2
    Join Date
    Jun 1999
    Location
    Germany
    Posts
    2

    Re: Scroll Bars on FormView initialization

    I'm not sure if it works, but I'd suggest to invoke "wndFormView->UpdateWindow()" after inserting any new controls. Maybe this doesn't help. In this case you can force the form view to recalculate the need for scrollbars by simply resizing it: (wndSDIFrame->GetWindowRect() and wndSDIFrame->MoveWindow()). You do not really need to give it another size and position - just hand over the current position and size that you received from GetWindowRect() to MoveWindow() unchanged.

    Torsten


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