VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Generating TreeView Controls at run time.(Using the same way you can generate any ActiveXControl at

by Bhuwan Chand Joshi (69 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 3rd June 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Generating TreeView Controls at run time.(Using the same way you can generate any ActiveXControl at run time. The only thing you require is

API Declarations


Dim intX as integer
Dim intY as integer

Rate Generating TreeView Controls at run time.(Using the same way you can generate any ActiveXControl at



Private Sub Form_Load()
On Error goto Err_Handler
intY=500
Licenses.Add "COMCTL.TreeCtrl.1","TreeView"
For intX=0 to 5
Set Obj=Controls.Add("COMCTL.TreeCtrl.1","TreeView" & intX)
Obj.Left=100
If intX=1 then
Obj.Top=intY + 500
else
Obj.Top=intY + 1000
End If
intY=Obj.Top
Obj.Visible=True
Next intX
Set Obj=Nothing
Err_Handler:
     MsgBox Err.Description
End Sub
'Removing TreeView Controls on the Click event of RemoveTreeView Button
Private Sub cmdRemoveTreeView()
On error goto Err_Handler
Licenses.Remove "COMCTL.TreeCtrl.1"
For intX= 0 to 5
Controls.Remove "TreeView" & intX
Next intX
Err_Handler:
    MsgBox Err.Description
End Sub

Download this snippet    Add to My Saved Code

Generating TreeView Controls at run time.(Using the same way you can generate any ActiveXControl at Comments

No comments have been posted about Generating TreeView Controls at run time.(Using the same way you can generate any ActiveXControl at. Why not be the first to post a comment about Generating TreeView Controls at run time.(Using the same way you can generate any ActiveXControl at.

Post your comment

Subject:
Message:
0/1000 characters