Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to print treeview content
Message
From
31/03/2009 11:29:48
Reza Meamar
Homa Programming Group
Shiraz, Iran
 
 
To
31/03/2009 11:21:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
01392376
Message ID:
01392395
Views:
64
>>Dear all,
>>Can i print treeview content?
>>thanks
>
>I had this to use for myself:
>
>
*Function TVLister
>Lparameters toTV
>  Local lnIndex,lnLastIndex
>  _Cliptext=''
>  With toTV
>    lnIndex     = .Nodes(1).Root.FirstSibling.Index
>    lnLastIndex = .Nodes(1).Root.LastSibling.Index
>    _GetSubNodes(lnIndex,toTV,lnIndex)
>    Do While lnIndex # lnLastIndex
>      lnIndex = .Nodes(lnIndex).Next.Index
>     _GetSubNodes(lnIndex,toTV,lnIndex)
>    Enddo
>  EndWith
>  Return _Cliptext
>
>Function _GetSubNodes
>  Lparameters tnIndex, toTV, tnRootIndex
>  Local lnIndex, lnLastIndex
>  With toTV



Thank you very much, i will test it.
>    WriteNode(tnIndex,toTV, tnRootIndex)
>    If .Nodes(tnIndex).Children > 0
>      lnIndex  = .Nodes(tnIndex).Child.Index
>      lnLastIndex = .Nodes(tnIndex).Child.LastSibling.Index
>      _GetSubNodes(lnIndex,toTV,tnRootIndex)
>      Do While lnIndex # lnLastIndex
>        lnIndex = .Nodes(lnIndex).Next.Index
>        _GetSubNodes(lnIndex,toTV,tnRootIndex)
>      Enddo
>    Endif
>  Endwith
>
>Function WriteNode
>  Lparameters tnCurIndex, toTV,tnRootIndex
>  Local lnRootIndex, lnIndex, lcPrefix, lcKey, lnLevel
>  lnIndex = tnCurIndex
>
>  With toTV
>    lcPrefix = '+-' + .Nodes(lnIndex).Text
>    lnLevel = 0
>    Do While lnIndex # tnRootIndex
>      lnIndex = .Nodes(lnIndex).Parent.Index
>      lcPrefix = Iif(.Nodes(lnIndex).LastSibling.Index = lnIndex,' ','|')+Space(3)+lcPrefix
>      lnLevel = lnLevel + 1
>    EndDo
>    _Cliptext = _Cliptext + lcPrefix + Chr(13)
>  Endwith
>
Cetin
Previous
Reply
Map
View

Click here to load this message in the networking platform