Microsoft KB Archive/108901

{|
 * width="100%"|

Sample Corrects Scrolling Problems in GRID.VBX

 * }

Q108901

-

The information in this article applies to:


 * The Microsoft Foundation Classes (MFC), used with:
 * Microsoft Visual C++, versions 1.0, 1.5

-

SUMMARY
GRIDFIX is a sample application the primary purpose of which is to provide a workaround for scrolling problems exhibited by GRID.VBX when used with Microsoft Visual C++ versions 1.0 and 1.5 for Windows.

This sample program also implements a complete keyboard interface for GRID.VBX.

The following files are available for download from the Microsoft Download Center:

Gridfix.exe

For additional information about how to download Microsoft Support files, click the article number below to view the article in the Microsoft Knowledge Base:

"Q119591 How to Obtain Microsoft Support Files from Online Services" Microsoft used the most current virus detection software available on the date of posting to scan this file for viruses. Once posted, the file is housed on secure servers that prevent any unauthorized changes to the file.

MORE INFORMATION
GRIDFIX demonstrates the correct procedure for subclassing a VBX control in a Microsoft Foundation Class (MFC) Libraries application. As a result of the subclassing procedure, the program has access to vertical and horizontal scroll messages and uses them to manually implement scrolling.

This sample program also implements a keyboard interface. This interface is normally used to navigate the grid using the arrow, HOME/END, PAGE UP/PAGE DOWN, and SHIFT keys. Unfortunately, the arrow keys are intercepted by the dialog manager, which uses them to traverse the controls on the dialog box.

The keyboard interface is implemented by handling WM_GETDLGCODE in the subclassed grid[ASCII 146]s message handler. DLGC_WANTARROWS is returned, which allows arrow keys to be forwarded to the control. The full keyboard interface allows grid navigation and region highlighting.

If you want to disable keyboard highlighting, remove the handlers for the WM_KEYDOWN and WM_KEYUP messages. If you want to totally disable the keyboard interface (but still correct scrolling problems), remove the handler for WM_GETDLGODE as well.

The GRIDFIX sample contains a copy of GRID.VBX. To use this control in a design-time environment (such as App Studio), you must have the license file VC.LIC in your WINDOWS\SYSTEM directory. This file is normally installed by the Setup program for Microsoft Visual C++ versions 1.0 and 1.5 for Windows.

Additional query words: VBX thumb

Keywords : kbfile kbsample kb16bitonly kbMFC kbVBX kbVC

Issue type :

Technology : kbAudDeveloper kbMFC