Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to print treeview content
Message
From
31/03/2009 11:21:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
31/03/2009 11:09:16
Reza Meamar
Homa Programming Group
Shiraz, Iran
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
01392376
Message ID:
01392385
Views:
99
This message has been marked as the solution to the initial question of the thread.
>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
    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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform