Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

[77] TreeView Control

Last post 03-03-2005 9:58 PM by jmhshep. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 01-01-1999 12:00 AM

    [77] TreeView Control

    This thread is for discussions of TreeView Control.

    • Post Points: 0
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 04-02-2002 12:33 PM In reply to

    • jbamt
    • Not Ranked
    • Joined on 04-02-2002
    • New Member
    • Points 10

    TreeView Control and images

    I might have missed it, but I would have liked to have seen how to use images without having to go to the imagelist tutorial.  I know you mentioned imagelist, but perhaps a brief explanation of using the imagelist control with TreeView would have been in order.  If I missed it, I apologize.  Thank you for a very helpful tutorial.
    • Post Points: 0
  • 04-02-2002 12:37 PM In reply to

    • jbamt
    • Not Ranked
    • Joined on 04-02-2002
    • New Member
    • Points 10

    TreeView Control and Images

    Sorry, I went back and read it more closely.  I just had to play around with the ImageList control to make it work.
    • Post Points: 0
  • 05-27-2002 3:08 PM In reply to

    • Helmoet
    • Not Ranked
    • Joined on 05-24-2002
    • New Member
    • Points 10

    Treeview example

    Hoped to find some example using directories and files...
    • Post Points: 0
  • 10-15-2002 12:44 AM In reply to

    • behring
    • Not Ranked
    • Joined on 10-15-2002
    • New Member
    • Points 10

    Excellent!!

    Thank You Example I make this!!

    I hope someOne found this useful

    Private Sub Form_Load()
    With TreeView1
           .Style = tvwTreelinesPlusMinusPictureText
           .LineStyle = tvwRootLines
           .PathSeparator = "\"
           .Indentation = Screen.TwipsPerPixelX * 5 '256
           .LabelEdit = tvwManual
           .SingleSel = False
           .HideSelection = False
           .ImageList = ImageList1        
           .Refresh
    End With
    Call ShowEstructure
    End Sub



    Private Sub ShowEstructure()
    Dim i As Byte
    Dim j As Byte
    Dim k As Byte
    Dim Max As Byte
    Dim sp As String
    Dim sh As String
    Dim sh2 As String
    Dim TotalSecciones As Byte
    Dim TotalPosiciones As Byte

    Dim rsSeccions As New ADODB.Recordset
    Dim rsPositions As New ADODB.Recordset

    TreeView1.Nodes.Clear


    Set grsGral = New ADODB.Recordset
    grsGral.Open "EXEC spSQL_ShowDepartments", gConnectionString, adOpenStatic, adLockReadOnly, 1
    Max = grsGral.RecordCount


    For i = 1 To Max
           'Actual Node        
            sp = "nodo" & CStr(i)
           
           TreeView1.Nodes.Add , , sp, grsGral.Fields(1).Value, 1
           grsGral.MoveNext
    Next
    grsGral.MoveFirst

    For i = 1 To Max
     ' leaf
           sp = "nodo" & CStr(i)
           Set rsSeccions = New ADODB.Recordset
           rsSeccions.Open "EXEC spSQL_ShowSeccions_forThis '" & grsGral.Fields(0).Value & "'", gConnectionString, adOpenStatic, adLockReadOnly, 1
           TotalSecciones = rsSeccions.RecordCount
           
           For j = 1 To TotalSecciones
               ' relative son
               sh = sp & "-" & CStr(j) 'j
               TreeView1.Nodes.Add sp, tvwChild, sh, rsSeccions.Fields(0).Value, 2
               
               '*-*-*-
               
                Set rsPositions = New ADODB.Recordset
                   rsPositions.Open "EXEC spSQL_ShowPositions_forThis '" & rsSeccions.Fields(1).Value & "'", gConnectionString, adOpenStatic, adLockReadOnly, 1
                   TotalPosiciones = rsPositions.RecordCount
                   
                   For k = 1 To TotalPosiciones
                       ' La clave del nodo hijo, relativo al nodo sP
                       sh2 = sh & "-" & CStr(k) 'j
                       TreeView1.Nodes.Add sh, tvwChild, sh2, rsPositions.Fields(0).Value, 3
                       rsPositions.MoveNext
                   Next
                   Set rsPositions = Nothing
               '*--*-*-
               
               rsSeccions.MoveNext
           Next
           Set rsSeccions = Nothing
           grsGral.MoveNext
    Next

    Set grsGral = Nothing
    End Sub

    • Post Points: 0
  • 10-30-2002 9:53 AM In reply to

    ASP pages

    Can this be implemented using ASP pages as well?

    Thanks.
    • Post Points: 0
  • 03-04-2003 11:00 PM In reply to

    Good Work

    Just what i needed for a contact list im doing for my MSN Clone. Excellent!
    • Post Points: 0
  • 05-08-2003 4:40 PM In reply to

    • nigeles
    • Not Ranked
    • Joined on 05-08-2003
    • New Member
    • Points 10

    treeview data source

    Enjoyed the piece on drag and drop treeview.  
    I use VS6 under XP and in that environment the DataObject declaration is
    Data As MSComctl2.DataObject
    rather than the reference in the posting
    Hyperlink to articles on DataSource and imagelist would be handy but they are both documented in MSDN if you throw the rigth incantation at it.

    Nigel
    • Post Points: 0
  • 06-24-2003 3:39 AM In reply to

    ??? Got Problems with that

    Hi,

    Found this very good tutorial because its nearly exact the problem i have with my TreeView,...
    ...but unfortunatly, i can't get it to work...

    Set the same settings like in the tutorial, but nothing happens.
    I try to drag and drop, but it seems, there is no action by the script,...

    Any suggetions, what my failure could be?
    Thanx for help
    LittleMik
    • Post Points: 0
  • 08-11-2003 8:25 PM In reply to

    • behmagvb
    • Not Ranked
    • Joined on 08-11-2003
    • New Member
    • Points 5

    Good

    Good Example isn't it?
    http://www.pldental.com
    • Post Points: 0
  • 05-14-2004 5:19 PM In reply to

    • gabar
    • Not Ranked
    • Joined on 05-14-2004
    • New Member
    • Points 5

    Good & Thanks

    Very Good, You have helped me.

    gabriel medina
    gxsoft@hotmail.com
    • Post Points: 0
  • 05-28-2004 10:39 AM In reply to

    treeview

    I tried this and recieved the following: Compile error: variable not defined..."TreeView" is highlited...anyone have any ideas?
    • Post Points: 0
  • 03-03-2005 9:58 PM In reply to

    • jmhshep
    • Not Ranked
    • Joined on 03-03-2005
    • New Member
    • Points 5

    treeview

    I tried your treeview example and when I try to add and image it is telling me that I need to initilaize the image first. Can you tell me what that means and how to fix it
    • Post Points: 0
Page 1 of 1 (13 items)