BUG: Valid Event Doesn't Fire in Control Array of Text BoxesLast reviewed: April 25, 1997Article ID: Q137950 |
The information in this article applies to:
SYMPTOMSPages 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.
WORKAROUNDThe 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
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 in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Steps to Reproduce ProblemFollow 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |