Wie kann ich aus C# Code heraus (ohne Designer) Elemente zu einem TreeView hinzufügen?
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace WinFormsApp1 {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
InitializeTreeView();
}
private void InitializeTreeView() {
TreeView treeView1 = new TreeView();
treeView1.Location = new System.Drawing.Point(10, 10);
treeView1.Size = new System.Drawing.Size(200, 300);
}
}
}