SftTree/NET 3.0 supports Windows Forms applications for .NET 10 (or later) as well as for the .NET Framework 4.7 (or later). The control's classes, properties, methods and events are the same on both.
.NET 10 projects reference SftTree/NET through its NuGet package Softelvdm.SftTreeNET. Setup installs the package in the SftTree/NET installation directory (\Program Files (x86)\Softelvdm\SftTree NET 3.0\NuGet\) and registers that folder as the package source "Softelvdm SftTree NET 3.0" for all users of the system.
In Visual Studio, create a new project from the "Windows Forms App" template (C# or Visual Basic) and select .NET 10.0 as the framework. An existing Windows Forms project for .NET 10 (or later) works the same way.
In Solution Explorer, right-click the project and select Manage NuGet Packages. On the Browse tab, select "Softelvdm SftTree NET 3.0" as the package source, select the package Softelvdm.SftTreeNET and click Install.
The package can also be added to the project file directly:
<ItemGroup> <PackageReference Include="Softelvdm.SftTreeNET" Version="3.0.0" /> </ItemGroup>
Open the form in the designer. The Toolbox shows the control as SftTree (Softelvdm.SftTreeNET) in the group Softelvdm.SftTreeNET. Drag it onto the form.
Click the smart tag at the top right corner of the control to open the SftTree Tasks. Edit Properties opens the property pages; Columns, Items, Headers and Footers open them on that page.
Build and run the application. The code example in Using SftTree/NET with .NET Framework works unchanged in .NET 10 projects.
Visual Studio's designer for .NET projects runs the controls on a form in a separate process. SftTree/NET supports this designer: the control is placed from the Toolbox, edited in the Properties window and through its smart tag, and its contents (items, headers and footers) are saved in the form's resource (.resx) file.
The property pages open from the smart tag and from the Properties window, as in .NET Framework projects. In .NET projects they edit a copy of the control, and the control on the form is updated when Apply is clicked.
.NET 10 no longer includes the BinaryFormatter, which SftTree/NET uses in .NET Framework applications to save the images and fonts in the control's contents (SftTree.GetContents, and the Contents resource of a form). In .NET 10 applications, SftTree/NET saves images as image files and fonts by their name, size, style, unit and character set instead.
To move a form from a .NET Framework project to a .NET 10 project, export the tree's items, headers and footers on the Items page of the property pages before the move. After the move, remove the tree's Contents entry from the form's .resx file and the line that sets the tree's Contents property in the form's InitializeComponent method, then import the exported file on the Items page and click Apply.
A .NET 10 application becomes per-monitor aware by calling Application.SetHighDpiMode(HighDpiMode.PerMonitorV2) before it creates its first window. See Per-Monitor DPI and Scaling.
When a .NET 10 application is built, Softelvdm.SftTreeNET.dll is copied from the NuGet package to the application's output folder. Distribute it with the application as described in Distributing SftTree/NET.