|
-
Apr 11th, 2001, 09:02 PM
#1
Thread Starter
Frenzied Member
Heres the code im using (in frmAdd, but it never seems to work!
Code:
frmMain.tvTreeView.Nodes.Add 2, , , "Test", 2, 2
I also tested it with
Code:
frmMain.tvTreeView.Refresh
but it still doesnt work
When I add the same code in frmMain (tvTreeView.Nodes.Add 2, , , "Test", 2, 2), it works perfectly... anyone know how I can add to a treeview from another form??
Last edited by qpabani; Apr 11th, 2001 at 09:10 PM.
-
Apr 11th, 2001, 09:49 PM
#2
So you are adding a node from another form?
Try going the extremly long way:
Code:
Dim nodX As Node
Set nodX = frmMain.tvTreeView.Nodes.Add 2, , , "Test", 2, 2
nodX.Visible = True
'blah blah blah
I've never done much work with Treeviews.
-
Apr 11th, 2001, 10:07 PM
#3
Thread Starter
Frenzied Member
it says syntax error, and highlights the first 2
-
Apr 11th, 2001, 10:34 PM
#4
Fanatic Member
Code:
Option Explicit
Private Sub Command1_Click()
' frmMain.tvTreeview.Nodes.Add 2, , , "Test", 2, 2
Dim nodX As Node
Set nodX = frmMain.tvTreeview.Nodes.Add(, , "R", "Root")
Set nodX = frmMain.tvTreeview.Nodes.Add("R", tvwChild, "C1", "Child 1")
Set nodX = frmMain.tvTreeview.Nodes.Add("R", tvwChild, "C2", "Child 2")
Set nodX = frmMain.tvTreeview.Nodes.Add("R", tvwChild, "C3", "Child 3")
Set nodX = frmMain.tvTreeview.Nodes.Add("R", tvwChild, "C4", "Child 4")
nodX.EnsureVisible
frmMain.tvTreeview.Style = tvwTreelinesText ' Style 4.
frmMain.tvTreeview.BorderStyle = vbFixedSingle
End Sub
Regards,
TheBao
-
Apr 12th, 2001, 07:38 PM
#5
Thread Starter
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|