1

Konu: tree view konusunda bir örnek lütfen

Tree view konusunda (iki den fazla alt seviyeli) bir örnek yada bir link rica edebilirmiyim ?
Gerek UT gerekse diğer sayfaların örneklerinin içinden çıkamadım.

Şimdiden Teşekkür ederim.

2

Re: tree view konusunda bir örnek lütfen

www.denbil.com/treeview.rar

3

Re: tree view konusunda bir örnek lütfen

Gokce,
Universalthread'de magazine bolumune bak. 2001 June sayisinda article olarak aciklama ve kod var.

Basit ornek:

#Define tvwFirst    0
#Define tvwLast    1
#Define tvwNext    2
#Define tvwPrevious    3
#Define tvwChild    4

Public oForm
oForm = Createobject('myForm')
oForm.Show()
With oForm.Tree
  .Left = 10
  .Top = 10
  .Width = 200
  .Height = 200
  .Nodes.Add(,tvwFirst,"root0",'Main node 0')
  .Nodes.Add(,tvwFirst,"root1",'Main node 1')
  .Nodes.Add(,tvwFirst,"root2",'Main node 2')

  * Add 2 child nodes to root1
  .Nodes.Add('root1',tvwChild,"child11",'Child11')
  .Nodes.Add('root1',tvwChild,"child12",'Child12')

  *Add a child node to root2
  .Nodes.Add('root2',tvwChild,"child23",'Child23')

  .Nodes.Add('child11',tvwChild,"child113",'child113')
  With .Nodes.Add('child113',tvwPrevious,"child112",'child112')
    .Bold=.T.
  Endwith
  With .Nodes.Add('child112',tvwPrevious,"child111",'child111')
    .Bold = .T.
  Endwith

  * Later decided to add another 2 nodes to root2
  * Place first before child23
  With .Nodes.Add('child23',tvwPrevious,"child22",'Child22')
    .Bold=.T.
    .BackColor = Rgb(0,255,255)
  Endwith
  * Place next before child22
  With .Nodes.Add('child22',tvwPrevious,"child21",'Child21')
    .Bold=.T.
    .ForeColor = Rgb(192,192,192)
  Endwith

  For Each oNode In .Nodes && Expand all nodes for easy view
    oNode.Expanded = .T.
  Endfor
Endwith

Define Class myForm As Form
  Add Object Tree As myTreeView
Enddefine

Define Class myTreeview As  OleControl OlePublic
  OleClass='MSComCtlLib.TreeCtrl'

  Procedure Init
    With This
      .linestyle = 1
      .Font.Name = 'Times New Roman'
      .Font.Size = 10
      .indentation = 5
      .PathSeparator = '\'
    Endwith
  Endproc

  Procedure NodeClick
    Lparameters toNode
    Messagebox(toNode.Key)
  Endproc
Enddefine

4 Son düzenleyen, Gökçe Özçınar (24.11.2006 19:06:39)

Re: tree view konusunda bir örnek lütfen

UT 'a  mutlaka bakacağım ama ikinizinde verdiği örnekten daha sade anlaşılır ve güzel olacağını hiç zannetmiyorum.

Sonsuz ikinizede teşekkürlerimle.

5

Re: tree view konusunda bir örnek lütfen

Emin olma, onu ben yazmıstım:)