Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 24th, 2004, 04:53 AM
Authorized User
 
Join Date: Sep 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default question about treeview

Hi ,

I have a question about generating treeview.Here is my code:
Public Class Form1
    Inherits System.Windows.Forms.Form

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim aa As New TreeNode(1)
        Dim bb As New TreeNode(2)
        Dim cc As New TreeNode(3)
        Dim dd As New TreeNode(4)
        aa.Nodes.Add(bb)
        aa.Nodes.Add(cc)
        bb.Nodes.Add(dd)
        cc.Nodes.Add(dd)
        TreeView1.Nodes.Add(aa)

    End Sub

End Class

the rusult is:
 4
 |
 1-2
   |
   3-4
but i hope the result is :
 1-2-4
   |
   3-4
How should I change my code?

Thanks a lot,

Haiying

 
Old September 25th, 2004, 05:04 AM
Authorized User
 
Join Date: Sep 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to someshtrivedi
Default

 hi, Try this

     Dim aa As New TreeNode(1)
        Dim bb As New TreeNode(2)
        Dim cc As New TreeNode(3)
        Dim dd As New TreeNode(4)

        bb.Nodes.Add(dd)
        cc.Nodes.Add(dd)
        bb.Nodes.Add(cc)
        TreeView1.Nodes.Add(bb)
        TreeView1.Nodes.Add(aa)

good luck
Somesh






Similar Threads
Thread Thread Starter Forum Replies Last Post
TreeView Apocolypse2005 Visual Basic 2005 Basics 1 May 21st, 2007 06:21 AM
treeview selectaction question lcsgeek ASP.NET 2.0 Basics 1 July 16th, 2006 11:59 PM
treeview question kalchev ASP.NET 2.0 Basics 1 March 22nd, 2006 03:29 PM
treeview SAIGORTI SQL Language 2 September 6th, 2005 07:31 PM
Treeview dkr72 VBScript 0 November 9th, 2004 12:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.