Share via


Custom Controls in the Dialog Editor

The Dialog editor lets you use existing "custom" or "user" controls in a dialog box template.

Note

Custom controls in this sense are not to be confused with ActiveX controls. ActiveX controls were sometimes called OLE custom controls. Also, don't confuse these controls with the owner-drawn controls in Windows.

This functionality is intended to let you use controls other than those supplied by Windows. At run time, the control is associated with a window class (not the same as a C++ class). A more common way to accomplish the same task is to install any control, such as a static control, in your dialog box. Then at run time, in the OnInitDialog function, remove that control and replace it with your own custom control.

This is an old technique. Today you are advised in most cases to write an ActiveX control or subclass a Windows common control.

For these custom controls, you are limited to:

  • Setting the location in the dialog box.

  • Typing a caption.

  • Identifying the name of the control's Windows class (your application code must register the control by this name).

  • Typing a 32-bit hexadecimal value that sets the control's style.

  • Setting the extended style.

For information on adding resources to managed projects, please see Resources in Applications in the .NET Framework Developer's Guide. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resources strings to properties, see Walkthrough: Localizing Windows Forms and Walkthrough: Using Resources for Localization with ASP.NET.

Requirements

Win32

See Also

Reference

Controls in Dialog Boxes

Concepts

Controls (MFC)