Setting the Width of a Horizontal Scroll Bar

 

The latest version of this topic can be found at Setting the Width of a Horizontal Scroll Bar.

The latest version of this topic can be found at Setting the Width of a Horizontal Scroll Bar.

When you add a list box with a horizontal scroll bar to a dialog box using MFC classes, the scroll bar will not automatically appear in your application.

To make the scroll bar appear

  1. Set a maximum width for the widest element by calling CListBox::SetHorizontalExtent in your code.

    Without this value set, the scroll bar will not appear, even when the items in the list box are wider than the box.

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

MFC

See Also

Controls in Dialog Boxes
Controls