CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2012
    Posts
    53

    Resizing Controls and Text content

    Hello all,

    I have a SDI application that uses a CFormView class to create a window and this window has 2 buttons and 2 edit boxes.

    I can resize this window, like minimize and maximize, but the controls all stay at the same place.

    I know that it's possible to move the controls based on window size.

    But what i want to do is, as the window is expanded the controls and it's text content to grow proportionally and same when the window is shrinked.

    Is that possible to do? i.e., increase/decrease size of controls and texts per window size.

    Any sample code will help.

    Thanks in advance.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: Resizing Controls and Text content

    Yes, it's possible.
    Handle WM_SIZE message in CFormView and resize all its child windows (you will have to enumerate them.)
    The same way change their font size (GetFont, GetLogFont, change font size, create new font, SetFont)
    Victor Nijegorodov

  3. #3
    Join Date
    Jul 2005
    Location
    Netherlands
    Posts
    2,042

    Re: Resizing Controls and Text content

    Cheers, D Drmmr

    Please put [code][/code] tags around your code to preserve indentation and make it more readable.

    As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky

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