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

    Resizing windows and scrollbars

    Hello,

    I have a template in Visual Studio with a Size of 250x80 containing a CStatic and a CEdit.
    This template (dialog resource) is used by a FormView which is embedded in another dialog, so that a subarea of the this dialog is scrollable. After Creation I use these two controls to dynamically create n lines of these controls and attach it to the dialog (it replaces a group box, I pass the rect of the group box to the create method). After adding the dynamic controls the FormView might have a size of 250x700 (for e.g.). So far everything works find. The only problem is some strange behaviour with the scroll bars.

    First I have to call SetScrollRange to make the scrollbar scroll to the end. It seems it is still working with the size of 80.

    If I want to resize the total size of the FormView using MoveWindow to the Size it has AFTER adding the dynamic controls, it's not within the size of the group box anymore.

    So somehow I have to change the size the window has in total, and which part is displayed. Because changing the windows size AFTER dynamically adding controls should not change the "view size".

    I hope it's clear somehow what I mean...
    Last edited by chaos2oo2; April 17th, 2012 at 07:06 AM.

  2. #2
    Join Date
    Mar 2004
    Location
    Central Florida
    Posts
    293

    Re: Resizing windows and scrollbars

    So what is your question?
    "Effective teaching is the essence of leadership..."

    "There is no substitute for a carefully thought-out design."

    If you have found this post to be useful, please Rate it.

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