Select Microsoft windows common controls 6.0 (SP6) from components
Add a TreeView control to the form.
Add a ImageList control to the form.
Add some bitmaps to the imagelist.
Set the name of image list to the Image List property of the Tree view control.
Add this sample code to the form
=============== ============== -
Private Sub Form_Load()
-
Dim Node1 As Node, Node2 As Node
-
Dim Node3 As Node, Node4 As Node
-
-
Set Node1 = tv1.Nodes.Add
-
tv1.Nodes(1).Text = "Node 1"
-
tv1.Nodes(1).Key = "Node 1"
-
tv1.Nodes(1).Image = "closed"
-
-
Set Node2 = tv1.Nodes.Add("Node 1", tvwChild, "Node 2")
-
tv1.Nodes(2).Text = "Node 2"
-
tv1.Nodes(2).Key = "Node 2"
-
tv1.Nodes(2).Image = "leaf"
-
-
Set Node3 = tv1.Nodes.Add("Node 1", tvwChild, "Node 3")
-
tv1.Nodes(3).Text = "Node 3"
-
tv1.Nodes(3).Key = "Node 3"
-
tv1.Nodes(3).Image = "closed"
-
-
Set Node4 = tv1.Nodes.Add("Node 3", tvwChild, "Node 4")
-
tv1.Nodes(4).Text = "Node 4"
-
tv1.Nodes(4).Key = "Node 4"
-
tv1.Nodes(4).Image = "leaf"
-
End Sub
-
-
Private Sub tv1_Collapse(ByVal Node As MSComctlLib.Node)
-
Node.Image = "closed"
-
End Sub
-
-
Private Sub tv1_Expand(ByVal Node As MSComctlLib.Node)
-
Node.Image = "open"
-
End Sub
-
-
NOTE--open,closed,lea f are the Key peoperty of the images in the image list
0 8798 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Aaron Queenan |
last post by:
How can I use the designer to add a context menu to a class which inherits
from a control, e.g. treeview, without adding the context menu to a form?
For example, to add a context menu with "Select All" and "Clear Selection"
to a checked list box?
Thanks,
Aaron Queenan.
|
by: DotNetJunky |
last post by:
I have built a control that runs an on-line help system. Depending on the
category you selected via dropdownlist, it goes out and gets the child
subcategories, and if there are any, adds a new dropdownlist to the screen
for selection. This continues until there are no children, and then it
checks for a help article list based on that last selection and displays
actual articles for display.
Adding the controls and getting everything...
|
by: tmaster |
last post by:
When I try to dynamically add a second sub menu item to this ContextMenu
item, I get an error 'Specified argument was out of the range of valid
values'.
Private Sub mnuTopics_Show_Select(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles mnuTopics_Show.Select
Dim mShowMenuItem As MenuItem
mShowMenuItem = DirectCast(sender, MenuItem)
|
by: pmcguire |
last post by:
I have a treeview with a lot of nodes. I want to load only the nodes that are initially visible when the form loads, and then continue to populate it in background and/or when the nodes are required by the user either scrolling or performing some other action that would move the treeview window to a particular "unloaded" node in the treeview
Any advice on how to go about this? It seems I need a way of sensing a scroll event in the treeview...
|
by: Progalex |
last post by:
Hi everybody!
I have a listview and a treeview in a form . With an OpenDialog I let the
user select multiple files and then these files are added to the listview
with the complete pathname, while they are added to the treeview without the
path (only file name). I'd like the user would be able to remove multiple
items selecting filenames from the listview.
So, items should be removed both from the listview and the treeview.
How can I do...
| |
by: Ray Booysen |
last post by:
Hi all
I have a treeview bound to a sitemap. Once the user is logged in, I'm
wanting the menu to expand to include additional items from a database
while retaining the items in the sitemap. Is this possible.
For example.
My menu has an item called "Books" defined in the sitemap. Once the
user logs in, I want sub menu-items to be created under books with all
|
by: =?Utf-8?B?QnJhZA==?= |
last post by:
VS,VB 2005
I have a treeview which i load data into in the forms load event
Adding Nodes and Children to the parent nodes works fine
to add a parent:
Me.tvGroups.Nodes.Add(GroupDataRow(0)("MenuGroupID").ToString,
GroupDataRow(0)("GroupLabel"))
to add a child to a Parent:
|
by: debasisdas |
last post by:
This sample code displays employee name in the treeview control from the emp table of Scott schema in oracle database.
To start with
Select Microsoft windows common controls 6.0 (SP6) from components
Add a TreeView and a ListView control to the form.
Add this sample code to the form
==========================
Dim con As New ADODB.Connection
|
by: metricspaces |
last post by:
Hi,
I'm using VB6 and the TreeView from "Microsoft Windows Common Controls.". Due to the bug http://support.microsoft.com/kb/182231 it is not possible to add more than 32767 nodes to the tree.
I want to add 100,000's items to the TreeView.
Is there anywork around for this problem?
Is there any other implementation of TreeView that I can use with VB6 and does not suffer from this problem?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |