Assign a treeview at design run time to other at design time 
Author Message
 Assign a treeview at design run time to other at design time

How can I asign a treeview at run time to other at design time?

Assume that tvwtree is a treeview at design time

Something like this:

dim tvw as treeview
set tvw = controls.add (....)
.
.
set tvwtree = tvw ???????



Tue, 09 Sep 2003 01:35:01 GMT  
 Assign a treeview at design run time to other at design time
To add a single Treeview:

Declarations.Section:
Private tvwTree As MSComctlLib.TreeView

Private Sub Form_Load()

    Set tvwTree = Me.Controls.Add("MSComctlLib.TreeCtrl", "tvwTree")
    With tvwTree
        .Move TreeView1.Left + TreeView1.Width + 90, _
          TreeView1.Top, TreeView1.Width, TreeView1.Height
        .Visible = True
    End With

End Sub

To add multiple TreeViews:

Declarations.Section:
Private tvwTree() As MSComctlLib.TreeView

Private Sub Form_Load()

Dim iIdx As Integer

    ReDim tvwTree(0 To 2)
    For iIdx = 0 To 2
        Set tvwTree(iIdx) = Me.Controls.Add("MSComctlLib.TreeCtrl",
"tvwTree" & CStr(iIdx))
        With tvwTree(iIdx)
            .Left = TreeView1.Left + TreeView1.Width + 90 + _
              (iIdx * (TreeView1.Width + 90))
            .Move .Left, TreeView1.Top, TreeView1.Width, TreeView1.Height
            .Visible = True
        End With
    Next

End Sub

Rocky Clark (Kath-Rock Software)


Quote:
> How can I asign a treeview at run time to other at design time?

> Assume that tvwtree is a treeview at design time

> Something like this:

> dim tvw as treeview
> set tvw = controls.add (....)
> .
> .
> set tvwtree = tvw ???????



Tue, 09 Sep 2003 05:54:36 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Code running in design time or run-time?

2. web service and updating web reference with vb.net design time vs run time

3. getting run-time behavior of a contained control in a user control at design time

4. web service and updating web reference with vb.net design time vs run time

5. Design time vs Run time

6. Run Time vs Design Time - No Current Record

7. MsgBox pauses App at Design time but not run time

8. Design Time vs Run Time

9. design-time functionality at run-time

10. Saving properties of ActiveX control from design time to run time

11. VB5, Run-time much slower than Design-time

12. Creating forms at run time, not design time.

 

 
Powered by phpBB® Forum Software