Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TreeView
Message
From
16/02/1999 17:44:35
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00188022
Message ID:
00188159
Views:
25
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
Map
View

Click here to load this message in the networking platform