PRB: Displayed Value Changes If Press TAB to Move into TextBoxID: Q138616 The information in this article applies to:
SYMPTOMSWhen you press the TAB key to move into a text box the contents of which is selected on entry and that text box displays numeric data in scientific notation, the displayed value may change.
CAUSEThe Width property of the text box is not sufficient to display the entire scientific notation expression.
RESOLUTIONIncrease the Width property of the text box to accommodate the maximum possible scientific notation expression of your data when that data is selected.
STATUSThis behavior is by design. When the text box contents are selected (highlighted), the font used to display the highlighted contents occupies more space than non-selected text. Therefore, the scientific notation expression displays as expected when the contents are not selected. Likewise, when you press the TAB key to move into the text box and its contents are selected, only the portion of the expression that wraps to the next line is displayed.
MORE INFORMATION
Steps to Reproduce BehaviorThe following sample program demonstrates the behavior. *-- Begin Program *-- Create an array from which to load records in a table. LOCAL ARRAY aBunchONums[3,1] *-- Create a table CREATE TABLE testtube FREE (number n(14,4)) *-- Load three records in the table with random numbers. =RAND(-1) FOR i = 1 to 3 ENDFOR
APPEND FROM ARRAY aBunchONums
GO TOP
*-- Instantiate a form based on custom form class, TestForm.
frmMyForm = CREATEOBJECT("TestForm")
*-- Add a text box to the form with format and picture clause.
*-- Display the form.
frmMyForm.show
READ EVENTS *-- Define a custom class based on the FORM baseclass. DEFINE CLASS TestForm AS FORM *-- Add command button to move between records.
*-- Add command button to exit the program (form).
*-- Add custom code to the Click event of cmdNext.
*-- Add custom code to the Click event of cmdQuit.
ENDDEFINE
*-- End custom class definition.
*-- End program.
Run this program. Press the TAB key until the text box has focus. Note the displayed value changes when you move into the text box. With the contents of the text box selected, press the HOME key on your keyboard. Now, you can see the leading characters of the scientific notation expression in the text box. Edit the program. Go to the line that contains the comment, "<== change this value." Change the line of code to read:
Run the changed program. Press the TAB key until the text box has the
focus. Now the displayed value does not change when you move into the text
box.
Additional reference words: 3.00 VFoxWin KBCategory: kbprg kbprb KBSubcategory: FxprgGeneral |
Last Reviewed: October 27, 1995 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |