Thanks to the support of netizens, some netizens said they could not use it, so I made another change here to write down the detailed usage method.
Step 1
Copy the file to your project. After downloading the source code, you will find that there are many projects, and some shoes will feel messy and don't mess up. Let me explain it.
There are many controls in this open source code. Here I only talk about tree controls. Copy BinaryComponents. SuperTree, BinaryComponents. Utility, BinaryComponents. WinFormsUtility to your project.
The first one is BinaryComponents. SuperTre, which is the tree control we will use. The other two are the classes used.
Step 2
Add these three projects to your project and add references
To add a project, right-click your solution and choose Add. Existing project.
For example
Find the three copied items and add them in order.
Let's take a look at the added results.
In this way, the instance is successfully added.
It cannot be added now. Project Reference is required.
First, add the reference of the presentation layer, that is, the layer with the WEIN form. I don't know what you mean. Here, my name is WindowsFormsApplication1, which is the default one. I have not modified it.
Right-click reference-> Add reference, such as a piece
Select the "project" tab and you will see the two projects you just added. Here you can select BinaryComponents. SuperTree and BinaryComponents. Utility.
OK. The layer is added.
Add the BinaryComponents. SuperTree layer in the same way, reference the BinaryComponents. Utility and BinaryComponents. WinFormsUtility
Now the reference is complete.
At this time, you will find that you have a lot of controls in the VS toolbox, such
Here we only use TreeControl and drag this control to your form.
You can.
The most important file to be copied is the Resources in SuperTreeTest. Here is the icon file, and then we need to set the three ICO files to embedded Resources.
Setting method, right-click the image attribute
Note that the binding method is used,
BinaryComponents.Utility.Assemblies.ManifestResources res = new BinaryComponents.Utility.Assemblies.ManifestResources("WindowsFormsApplication1");
Change WindowsFormsApplication1 to your project name.
Now, I have uploaded the test code. You can download it.
The animage attribute of the control is gradually expanded when it is set to TRUE.
Now I want to bind a code, but it is limited. Can I write an infinitely bound code?
private void FillTreeControl( BinaryComponents.SuperTree.TreeControl treeControl )
{
BinaryComponents.Utility.Assemblies.ManifestResources res = new BinaryComponents.Utility.Assemblies.ManifestResources( "SuperTreeTest" );
using( treeControl.SuspendUpdates() )
{
treeControl.Icons.Add( res.GetIcon( "Resources.FeedTreeItem16.ico" ) );
treeControl.Icons.Add( res.GetIcon( "Resources.CollapsedFolderTreeItem16.ico" ) );
treeControl.Icons.Add( res.GetIcon( "Resources.ExpandedFolderTreeItem16.ico" ) );
for( int x = 1; x <= 5; ++x )
{
BinaryComponents.SuperTree.TreeNode xtn = treeControl.RootNodes.Add();
xtn.Text = string.Format( "Folder - X - {0}", x );
xtn.ExpandedImageIndex = 2;
xtn.CollapsedImageIndex = 1;
for( int y = 1; y <= 5; ++y )
{
BinaryComponents.SuperTree.TreeNode ytn = xtn.ChildNodes.Add();
ytn.Text = string.Format( "Folder - Y - {0}", y );
ytn.ExpandedImageIndex = 2;
ytn.CollapsedImageIndex = 1;
for( int z = 1; z <= 5; ++z )
{
BinaryComponents.SuperTree.TreeNode ztn = ytn.ChildNodes.Add();
ztn.Text = string.Format( "Subscription - Z - {0}", z );
ztn.ExpandedImageIndex = 0;
ztn.CollapsedImageIndex = 0;
}
}
}
}
}
Call Method
FillTreeControl (treeControl1 );
: Http://www.51ascx.com/68.html