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
Re: Treeview and Textboxes help please
Re: Treeview and Textboxes help please
:wave: WELCOME ON THE FORUMS :wave:
PLEASE USE <VBCODE> FOR SENDING CODEING :wave:
:wave: WELCOME ON THE FORUMS :wave:
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.
Re: Treeview and Textboxes help please
VB Code:
Private Sub Command1_Click()
Dim node As node
For Each node In TreeView1.Nodes
Debug.Print node.Text
Next
End Sub
THATS UR SOLUTION
Re: Treeview and Textboxes help please
Vbcode goes between brackets [vbcode][/vbcode], not <vbcode][/vbcode> less than/greater than symbols.
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:
Private Sub Form_Load()
' Visual Bbasic 6 Sample Window Application
' To run this project Add 3 differnt text boxes and
' 3 differnt lables and one Combobox and one Treview in your Form1
' ComboBox control is named "cmbSchoolView."
' TreeView Control is named "TV1)
Dim nodX As Node
With cmbSchoolView
'Prompt user to select school
cmbSchoolView.Text = "Slect School"
' Show Schools in combo box
' School Names List
.AddItem "School A"
.AddItem "School B"
.AddItem "School C"
End With
' Treeview data show
Set nodX = TV1.Nodes.Add(, , "R", "Root")
nodX.Expanded = True
Set nodX = TV1.Nodes.Add(, , "P", "Parent")
nodX.Expanded = True
Set nodX = TV1.Nodes.Add("R", tvwChild, , "School A")
Set nodX = TV1.Nodes.Add("R", tvwChild, , "School B")
Set nodX = TV1.Nodes.Add("R", tvwChild, , "School C")
End Sub
Private Sub cmbSchoolView_Click()
' 1) Array for School Area
Dim SchoolLocation(3) As String
' 2) Array for School Twon
Dim SchoolArea(3) As String
' 3) Array SchoolStreet
Dim SchoolStreet(3) As String
' Assign the array elements for School Area
SchoolLocation(0) = "Colorado"
SchoolLocation(1) = "Georgia"
SchoolLocation(2) = "New York"
' Assign the array elements for School Area
SchoolArea(0) = "101-A"
SchoolArea(1) = "102-B"
SchoolArea(2) = "103-C"
' Assign the array elements for School Street
SchoolStreet(0) = "Col, St. 101"
SchoolStreet(1) = "Geo, St. 102"
SchoolStreet(2) = "Ny, St. 103"
'Assign one array element to the text boxes
Text1.Text = SchoolLocation(cmbSchoolView.ListIndex) ' 1)
Text2.Text = SchoolArea(cmbSchoolView.ListIndex) ' 2)
Text3.Text = SchoolStreet(cmbSchoolView.ListIndex) ' 3)
End Sub
Re: Treeview and Textboxes help please
Related threads merged.
There is no reason to create two threads on the same topic. :)
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
Re: Treeview and Textboxes help please
never mind guys, i found the solution
we just have to use case select statement