Results 1 to 10 of 10

Thread: Treeview and Textboxes help please

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    4

    Treeview and Textboxes help please

    hi all

    I,am new in visual basic programming and using VB6

    I have one treeview and (2) textboxes in the same form

    what i wanna do is that

    whien the user to click the node some information (data) will be shown automatically in list boxes

    Assuming that data to be shown in both list boxes is an array
    i.e for example, my data is stored in the below array example

    VB code

    ' Data array to be shown in list boxes No. 1 when user clik the node

    Dim IPN_sch40(10) As String

    IPN_sch40(1) = "School 1"
    IPN_sch40(2) = "School 2"
    IPN_sch40(3) = "School 3"


    ' Data array to be shown in list boxes No. 2 when user clik the same node

    Dim IPE_sch40(3) As String

    IPN_sch40(1) = "Area 1"
    IPN_sch40(2) = "Area 2"
    IPN_sch40(3) = "Area 3"


    please help

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Treeview and Textboxes help please

    Moved to ClassicVb.

  3. #3
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Treeview and Textboxes help please

    WELCOME ON THE FORUMS

    PLEASE USE <VBCODE> FOR SENDING CODEING

    WELCOME ON THE FORUMS

  4. #4
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Treeview and Textboxes help please

    No really helpful Shakti... Hehehehehe.
    Also a warm welcome from me.

    I'm trying to imagine what you are trying to accomplish. If you told us more about the project perhaps we can help you out.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  5. #5
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Treeview and Textboxes help please

    VB Code:
    1. Private Sub Command1_Click()
    2. Dim node As node
    3.  
    4. For Each node In TreeView1.Nodes
    5.     Debug.Print node.Text
    6. Next
    7. End Sub

    THATS UR SOLUTION
    Last edited by Hack; May 22nd, 2006 at 08:21 AM. Reason: Fixed [vbcode] [/vbcode] tags

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Treeview and Textboxes help please

    Vbcode goes between brackets [vbcode][/vbcode], not <vbcode][/vbcode> less than/greater than symbols.

  7. #7

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    4

    TextBoxes and TreeView - HELP PLEASE

    Hi All

    I just started to learn VB and have a problem and i need some help to code it

    The below sample has been made using VB 6

    Problem :

    How to use the below sample to do the following:

    1) on click of Treview node the array data shall be appeared in
    Textboxes 1 & 2 3


    VB Code:
    1. Private Sub Form_Load()
    2.  
    3. ' Visual Bbasic 6 Sample Window Application
    4. ' To run this project Add 3 differnt text boxes and
    5. ' 3 differnt lables and one Combobox and one Treview in your Form1
    6. ' ComboBox control is named "cmbSchoolView."
    7. ' TreeView Control is named "TV1)
    8.  
    9.     Dim nodX As Node
    10.    
    11.     With cmbSchoolView
    12.    
    13.     'Prompt user to select school
    14.    
    15.       cmbSchoolView.Text = "Slect School"
    16.      
    17.       ' Show Schools in combo box
    18.       ' School Names List
    19.      
    20.       .AddItem "School A"
    21.       .AddItem "School B"
    22.       .AddItem "School C"
    23.    
    24.     End With
    25.    
    26. ' Treeview data show
    27.    
    28.    Set nodX = TV1.Nodes.Add(, , "R", "Root")
    29.    
    30.    nodX.Expanded = True
    31.    Set nodX = TV1.Nodes.Add(, , "P", "Parent")
    32.    nodX.Expanded = True
    33.    
    34.    Set nodX = TV1.Nodes.Add("R", tvwChild, , "School A")
    35.    Set nodX = TV1.Nodes.Add("R", tvwChild, , "School B")
    36.    Set nodX = TV1.Nodes.Add("R", tvwChild, , "School C")
    37.      
    38. End Sub
    39.  
    40. Private Sub cmbSchoolView_Click()
    41.    
    42.    ' 1) Array for School Area
    43.     Dim SchoolLocation(3) As String
    44.    
    45.    ' 2) Array for School Twon
    46.     Dim SchoolArea(3) As String
    47.    
    48.    ' 3) Array SchoolStreet
    49.     Dim SchoolStreet(3) As String
    50.    
    51.     ' Assign the array elements for School Area
    52.    
    53.     SchoolLocation(0) = "Colorado"
    54.     SchoolLocation(1) = "Georgia"
    55.     SchoolLocation(2) = "New York"
    56.    
    57.     ' Assign the array elements for School Area
    58.      
    59.     SchoolArea(0) = "101-A"
    60.     SchoolArea(1) = "102-B"
    61.     SchoolArea(2) = "103-C"
    62.    
    63.    ' Assign the array elements for School Street
    64.    
    65.     SchoolStreet(0) = "Col, St. 101"
    66.     SchoolStreet(1) = "Geo, St. 102"
    67.     SchoolStreet(2) = "Ny, St. 103"
    68.    
    69.     'Assign one array element to the text boxes
    70.    
    71.     Text1.Text = SchoolLocation(cmbSchoolView.ListIndex)        ' 1)
    72.     Text2.Text = SchoolArea(cmbSchoolView.ListIndex)            ' 2)
    73.     Text3.Text = SchoolStreet(cmbSchoolView.ListIndex)          ' 3)
    74.      
    75. End Sub

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Treeview and Textboxes help please

    Related threads merged.

    There is no reason to create two threads on the same topic.

  9. #9

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    4

    Re: Treeview and Textboxes help please

    Thanks guys for your post and sorry for any mistakes i,am totally new in forum

    and really i need help to finish this school project

  10. #10

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    4

    Re: Treeview and Textboxes help please

    never mind guys, i found the solution

    we just have to use case select statement

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width