Sizable dialogs at its easiest | CodeGuru

Sizable dialogs at its easiest

Introduction: Q: What is the difference between the following two dialogs ?   A: There is no difference ! The cdxCSizingDialog class is a class derived from CDialog making it very easy to implement sizable dialogs. I really missed that feature in VC++ (and IMHO it’s a shame to the MFC that it doesn’t provide […]

Written By
CodeGuru Staff
CodeGuru Staff
Aug 7, 1998
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Introduction:

Q: What is the difference between the
following two dialogs ?

 small dialogbig dialog

A: There is no difference !

The cdxCSizingDialog class is a class derived from CDialog making it very
easy to implement sizable dialogs. I really missed that feature in VC++ (and IMHO it’s a
shame to the MFC that it doesn’t provide an easy to use way to solve this problem).
However, now it is possible to make your dialogs sizable – you can add this to an existing
dialog in three steps !

In addition to cdxCSizingDialog, you will even find both cdxCSizingPropSheet
and cdxCSizingPropPage in the two files that are part of the zip, but these are
considered to be in beta stadium for now (they seem to work … I only have problems with
the sizing icon).

The most important features of cdxCSizingDialog are:

  • Easy to add even to already existing dialog classes.
  • Several ways controls may react on window size changes, from a simple nothing to
    a percentage-value;
  • Automatic creation of a standard-windows sizing icon (as used by the explorer’s windows)
    in the lower right corner of your dialog.
  • Support to load/store window position to the registry.

Requirements:

  • Tested and used with Visual C++ 5.0.

Files:

  • cdxCSizingDialog.h (header; can be found in the archive)
  • cdxCSizingDialog.cpp (implementation; can be found in the archive)
  • Sample application (includes a documentation; see
    sub-directory "doc" in the archive)

How to use:

    Make your dialog sizable in 3 steps !!

  1. Every control on our dialog needs a DDX value of class control (use Class Wizard
    in the resource editor).
  2. In both the header and implementation file, replace all strings "CDialog"
    by "cdxCSizingDialog" and insert an #include
    "cdxCSizingDialog.h"
    to your header file.
  3. In OnInitDialog(), make a call to AddSzControl() for each control you
    want to resize/reposition if the dialog’s size changes.
  4. Additional features might be used… see the documentation.
    A simple tutorial is included in the documentation that might
    be found here
CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.