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
    Location
    Texas, USA
    Posts
    568

    Dynamically Centering Control in View

    Hi everybody,

    I have a project that has a splitter window. On the right pane, I am dynamically changing the views depending on what the user selects in the left pane. My problem is this, hopefully it is simple. One of the right hand views happens to be a CPropertySheet object. I am centering this window when it first pops up. Works great! But when the user resizes the frame window, it screws it up. I would like to be able to center the window after the user is through. I have tried overriding OnDraw and OnSize by calling

    m_pSheet->CenterWindow();

    but it does not work the way I would like it. Do I need to take care of this myself with functions like MoveWindow or SetWindowPos, or is there a place I can put the CenterWindow function to make it work.

    Thanks in advance,

    Wayne



  2. #2
    Join Date
    May 1999
    Posts
    24

    Re: Dynamically Centering Control in View

    Go to http://www.codeguru.com\/misc/geometry.shtml

    You can AddConstraint() to any or all controls, and it works great!

    Paul


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