PRB: ScrollBar and Custom Controls Do Not Have Events to Handle (183528)
The information in this article applies to:
- The ClassWizard, when used with:
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 2.2
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.0a
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Editions 4.2b
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 4.2
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q183528 SYMPTOMS
When you double-click a Scroll Bar or custom control in the Visual C++
Dialog editor, the New Windows Message and Event Handlers dialog box
appears. However, no events are displayed for the control.
On the Message Maps tab of the MFC ClassWizard dialog box, select a dialog
class. The Messages list is blank for Object IDs corresponding to a Scroll
Bar or custom control.
CAUSE
The Scroll Bar and custom controls do not send notification messages so the
MFC ClassWizard cannot list any messages to map.
RESOLUTION
Use the ClassWizard, as follows, to add WM_HSCROLL or WM_VSCROLL message
handlers to the class of the parent window that hosts the Scroll Bar
control: - Press CTRL+W to open the MFC ClassWizard.
- On the Message Maps tab, select the dialog class in the Class name box.
- In the Object IDs list box, select the dialog class.
- In the Messages list box, select WM_HSCROLL or WM_VSCROLL, then click
Add Function.
For the user-defined messages of a custom control, or the
WM_CTLCOLORSCROLLBAR message, manually add message handlers to the parent
window's class. For additional information, please see the following
article in the Microsoft Knowledge Base:
99848 Use ON_MESSAGE() Macro to Map Less-Common Messages
STATUS
This behavior is by design.
REFERENCES
Visual C++ Online Books; search on "Scroll Bar Messages"
Platform, SDK, and DDK Documentation: Platform SDK; User Interface
Services; Controls; Scroll Bars; Scroll Bar Reference; Scroll Bar Messages
Modification Type: | Major | Last Reviewed: | 12/1/2003 |
---|
Keywords: | kbide kbprb kbwizard KB183528 |
---|
|