How to Prevent a Grid Header from Being Resized InteractivelyID: Q141722 3.00 3.00b WINDOWS kbprg kbhowto The information in this article applies to:
SUMMARYIn a grid object, the default behavior allows a user to resize the header by clicking and dragging it. The grid header could potentially be pulled down so that it covers the entire grid object and all of the data contained within it. This article demonstrates how to use program code to prevent a user from resizing the header of a grid.
MORE INFORMATIONThe following example creates a new property for the form to store the original size of the grid's HeaderHeight Property. Then, in the MouseUp event of the grid, the HeaderHeight Property is reset to its the original size should a user attempt to change it while running the form.
Step-by-Step Example1. Create a new form. 2. On the Form menu, click New Property, and create a property called 3. Place the following code in the Init event of the form:
4. Add the Customer table to the Data Environment of the form (on the View
5. Click the title bar of the Customer table, and drag it onto the form to
6. With the grid as the selected object on the form, set the ColumnCount
7. Add the following code to the MouseUp event of the grid:
8. Save the form as Test. Close it, and use the DO FORM command to run
9. Attempt to resize the header by clicking and dragging from the top, left
Additional reference words: 3.00 3.00b VFoxWin
KBCategory: kbprg kbhowto
KBSubcategory: FxprgGrid
|
Last Reviewed: December 26, 1995 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |