General information
Category:
ActiveX controls in VFP
Juan, I am trying to use the TreeView object in one of my forms
but I do not seem to find a way to input the data to
How do you do that??
>As a follow up to Fred Taylor's advice, I normally a TreeView's SelectedItem as follow:
>
>*-- The following will provide you with a public array called aTreeNodes
>*-- which will contain the hierarchy of your TreeView. You can then
>*-- have an idea what values you would like to remove.
>
>IF !ISNULL( THISFORM.TreeView.SelectedItem )
> m.lnTreeNodes = ListToArray( THISFORM.TreeView.SelectedItem.FullPath, "aTreeNodes", THISFORM.TreeView.PathSeparator )
>
>ENDIF
>
>
>*********************************
>FUNCTION ListToArray( m.lcList, aArray, m.lcDelimiter )
>*********************************
>* This function takes a list string delimited by m.lcDelimiter and
>* creates an array "aArray" of the values. Return value is the number
>* of elements in the final array.
>* ie: m.lnEntries = ListToArray( "1,2,3,4,5", "aMyArray", "," )
>LOCAL m.lnDelimCount, x, m.lnStartPos, m.lnDelimPos,;
> m.lnElements, m.lnEndPos, m.lnWidth
>
>m.lnElements = 0
>m.lnDelimCount = OCCURS( m.lcDelimiter, m.lcList )
>
>IF !EMPTY( m.lcList )
> PUBLIC &aArray
> IF m.lnDelimCount == 0
> m.lnElements = m.lnElements + 1
> DIMENSION &aArray.[1,1]
> &aArray.[1,1] = ALLTRIM(m.lcList)
> ELSE
> m.lnStartPos = 1
> DIMENSION &aArray.[lnDelimCount+1,1]
> FOR x = 1 TO m.lnDelimCount
> m.lnElements = m.lnElements + 1
> m.lnDelimPos = AT( m.lcDelimiter, m.lcList, x )
> m.lnEndPos = IIF( m.lnDelimPos == 0, LEN( m.lcList ) + 1, m.lnDelimPos )
> m.lnWidth = ( m.lnEndPos - m.lnStartPos )
>
> m.lcValue = ALLTRIM(SUBSTR( m.lcList, m.lnStartPos, m.lnWidth ))
> &aArray.[lnElements,1]=lcValue
> m.lnStartPos = m.lnDelimPos + 1
> ENDFOR
> m.lnElements = m.lnElements + 1
> &aArray.[lnElements,1]=ALLTRIM(SUBSTR( m.lcList, m.lnStartPos ))
> ENDIF
>ENDIF
>
>RETURN( m.lnElements )
>
>Best of Luck
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only