How to Use Grid MouseDown Code to Prevent Row/Partition ResizeID: Q146222 3.00 3.00b WINDOWS
The information in this article applies to:
SUMMARYThere are no Grid properties that can be used to disable the ability to use the mouse to resize the Grid HeaderHeight and RowHeight or move the Partition Slider. However, code can be placed in the user procedure associated with the Grid MouseDown event to prevent any of the following actions being made with the mouse:
MORE INFORMATIONTo cause the mouse action to be ignored at certain times, a NODEFAULT is conditionally executed in the Grid MouseDown code depending on the mouse coordinates. This effectively prevents access to the three previously listed properties. The following code example is designed for a grid that can be used in a form, on a page of a pageframe or within a container, regardless of nesting level. Place the following code in the procedure associated with the MouseDown event for the grid. ****** Start of Grid MouseDown ************************************************************* * If the grid is on a form (not in a container or pageframe), * this section may be omitted. It iterates through * object nesting level for all objects above the grid in the * hierarchy and makes necessary adjustments to nXCoord and * nYCoord. This allows the NODEFAULT to be called at the appropriate * time regardless of whether the grid is in a container, page in * a pageframe, or a combination that contains several layers. LOCAL cObjlist, nTopTotal, nLeftTotal cObjlist = '' nLeftTotal = 0 nTopTotal = 0
ENDIF
* Strip off grid name and replace form name with 'thisform' cObjlist='thisform' + SUBSTR(cObjlist,AT('.',cObjlist), ; ENDIF
* End of section to omit if grid is directly on form
****************************************************
WITH this
ENDWITH
NotesThere are 12 x 20 pixel areas where the pointer changes to a two-headed up/down arrow and the HeaderHeight or RowHeight may be resized. For the HeaderHeight, this is at the lower edge of the Header on the left side of the grid. For the RowHeight, this is at the lower edge of the first row of data on the left side of the grid. Likewise, there is a 19 x 6 pixel area where the pointer changes to a two-headed left/right arrow and the Partition Slider may be moved. This is the small black rectangle to the left of the grid's horizontal scroll bar. Although the pointer will still change when moved over these areas when you use the code example, you will not be able to make adjustments. There are slight differences between the calculation of the location of objects placed within pageframe and container objects in Windows 95, Windows NT, and Windows 3.1x. The following code conditionally makes these adjustments depending on the operating system:
Additional reference words: 3.00 3.00b VFoxWin
KBCategory: kbhowto
KBSubcategory: FxprgGrid
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |