BUG: Valid Event Doesn't Fire in Control Array of Text Boxes

Last reviewed: April 25, 1997
Article ID: Q137950
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 5.0a

SYMPTOMS

Pages 78 - 79 of the Developer's Guide give an example of creating a control array containing command buttons and check boxes. While this example works, creating a control array containing text boxes does not work as expected.

WORKAROUND

The following code demonstrates how to create a form with a control array that has three text boxes:

*_ there are 2 bugs here they are pointed out with comments PUBLIC oForm oForm = CREATEOBJECT("Form") oForm.AddObject("myarray","ctrlarr") oForm.myarray.Visible = 1 oForm.Visible = 1

DEFINE CLASS ctrlarr AS Container *- Make this a control array DIMENSION txtdim(3) ADD OBJECT txtdim(1) AS mytext WITH Top = 10 ADD OBJECT txtdim(2) AS mytext WITH Top = 40 ADD OBJECT txtdim(3) AS mytext WITH Top = 70

PROCEDURE txtdim.VALID

   LPARAMETERS nIndex
   WAIT WINDOW PROGRAM() + ' ' + This.Parent.txtdim(nIndex).value
********************************************************************** * Should be able to use this syntax this(nIndex).value not * this.parent.txtdim(nIndex).value*** ********************************************************************** ENDPROC ENDDEFINE

DEFINE CLASS mytext AS TextBox ********************************************************************** * If the following two lines are changed to comments, the valid in the * control array won't fire *** **********************************************************************

PROCEDURE VALID ENDPROC ENDDEFINE

*** end code

STATUS

Microsoft 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 in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

Follow the example in the Developer's Guide. For example:

PUBLIC oForm oForm = CREATEOBJECT("Form") oForm.AddObject("myarray","ctrlarr") oForm.myarray.visible = 1 oForm.Visible = 1

DEFINE CLASS ctrlarr AS Container *- Make this a control array DIMENSION txtdim(3) ADD OBJECT txtdim(1) AS textbox WITH Top = 10 ADD OBJECT txtdim(2) AS textbox WITH Top = 40 ADD OBJECT txtdim(3) AS textbox WITH Top = 70

PROCEDURE txtdim.Valid LPARAMETERS nIndex

   WAIT WINDOW This(nIndex).Value + ' ' + STR(nindex)
ENDDEFINE

The code should work. When you run it, no errors occur, but the Valid event does not fire.


KBCategory: kbprg kbcode kbbuglist
KBSubcategory: FxprgGeneral vfoxwinbuglist5.00 buglist3.00 buglist3.00b
Additional reference words: 5.00 3.00 3.00b
Keywords : buglist3.00 buglist3.00b buglist5.00 FxprgGeneral vfoxwin vfpbug5.0a kbcode kbprg kbbuglist
Version : 3.0 3.0b 5.0 5.0a
Platform : WINDOWS
Issue type : kbbug


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 25, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.