main logo
Subject: SetFocusToFirst and OptionGroups
Author: Frank Cazabon
Posted: 2001/04/19 10:11:52
 
View Entire Thread
New Search


Hi,

I've been using the SetFocusToFirstCode from a pretty old version of Codebook (probably a few years ago when eBizObj was first being introduced).

I have recently realised the code does not work when an OptionGroup is the first object in the container. The OptionGroup does not get added to the laControls array.

The section of code that stops this is:

*---------------------------------------------
*--- Find all controls in this container that
*--- 1. Possess a TabIndex property
*--- 2. Possess a SetFocus method
*--- 3. Are Enabled
*--- Save a reference to the control along
*--- along with the value of its TabIndex
*--- property into an array
*---------------------------------------------
FOR lnControl = 1 TO toContainer.ControlCount
IF TYPE('toContainer.Controls(lnControl).TabIndex') == 'N' AND ;
PEMSTATUS(toContainer.Controls(lnControl),'SetFocus',5) AND ;
toContainer.Controls(lnControl).Enabled

IF TYPE('laControls[1,1]') == 'O'
DIMENSION laControls[ALEN(laControls,1)+1,2]
ENDIF
*--------------------------------------
*--- Save a reference to the control
*--------------------------------------
laControls[ALEN(laControls,1),1] = toContainer.Controls(lnControl)
*-----------------------------------
*--- Save the control's tab index
*-----------------------------------
laControls[ALEN(laControls,1),2] = toContainer.Controls(lnControl).TabIndex
ENDIF
ENDFOR

the problem is that the OptionGroup does not have a SetFocus method.

is there a later version of SetFocusToFirst that works with OptionGroups?

Thanks

Frank Cazabon

www.samaansystems.com
 
©2001 Frank Cazabon
<-- Prior Message New Search Next Message -->