BUG: WCOLS() and WROWS() Do Not Match SIZE ClauseID: Q117234 The information in this article applies to:
SYMPTOMSThe value returned by WCOLS() or WROWS() is not consistent with the values specified after the SIZE clause of a DEFINE WINDOW command.
CAUSEWhen the SIZE clause of the DEFINE WINDOW command is used to define a window, the resulting window will be one pixel higher and one pixel wider than expected. The difference between the values reported by WCOLS() or WROWS() and the specified size will vary if the window contains a scroll bar or if clauses other than SIZE, FROM, and FONT are specified after the DEFINE WINDOW command.
RESOLUTIONWhen the SIZE clause is used with the DEFINE WINDOW command, the resulting window will always be one pixel higher and one pixel wider than specified. If the additional pixel is not desired, you must specify lower values after the SIZE clause so a window of the desired height and width can be defined. Since the FONTMETRIC() function can be used to determine the size of the differential, you can calculate the values that must be used to compensate for this behavior. For examples of how to perform these calculations, see the "More Information" section below. NOTE: This solution applies only to windows that are defined with the DEFINE WINDOW clause and for which no clauses other than SIZE, FROM, and FONT are specified. This solution does not apply to windows with scroll bars.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here as it becomes available.
MORE INFORMATIONThe following code sample demonstrates and explains the difference between the values returned by WCOLS() and WROWS() and the values specified after the SIZE clause of the DEFINE WINDOW command:
The following code samples can be used to convert between the expected
values and the actual values. The code samples shown below assume that a
window is defined in the manner illustrated above; that is, the memory
variable names used in the example above are used in these code samples.
Actual numeric or character values can be used instead of variables.
To determine the number of rows that were specified after the SIZE clause of the DEFINE WINDOW command, this code can be executed when the window is active:
To determine the number of columns that were specified after the SIZE
clause of the DEFINE WINDOW command, this code can be executed when the
window is active:
The following code produces a window of the desired size when the SIZE
clause of the DEFINE WINDOW command is used to specify the size of the
window:
Additional reference words: FoxMac FoxWin 2.50 2.50a 2.50b 2.50c 2.60
buglist2.50
buglist2.50a buglist2.50b buglist2.50c buglist2.60
KBCategory: kbenv kbprg kbbuglist
KBSubcategory: FxenvMemory
|
|
Last Reviewed: June 27, 1995 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |