C
TreeView Kullanımı
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace treenode_ex { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { //Yeni Kategori Ekle TreeNode secilen; secilen = treeView1.SelectedNode; if (radioButton1.Checked) { treeView1.Nodes.Add(textBox1.Text); } else if (radioButton2.Checked) { secilen.Nodes.Add(textBox1.Text); } } private void button2_Click(object sender, EventArgs e) { //İşaretli Kategorileri Sil TreeNode secilen; secilen = treeView1.SelectedNode; if (!(secilen.Parent == null)) { secilen.Parent.Nodes.Remove(secilen); } else { treeView1.Nodes.Remove(secilen); } } private void button3_Click(object sender, EventArgs e) { //Hepsini göster treeView1.ExpandAll(); } private void button4_Click(object sender, EventArgs e) { //Kategori göster TreeNode secilen; secilen = treeView1.SelectedNode; MessageBox.Show(secilen.Text); } } }