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 NavBar{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { NavBarItem item; navBar1.AddGroup().Title = "控制面板"; item = navBar1[0].AddItem(); item.ImageIndex = 0; item.Text = "区域选项"; item = navBar1[0].AddItem(); item.ImageIndex = 1; item.Text = "字体"; item = navBar1[0].AddItem(); item.ImageIndex = 2; item.Text = "添加硬件"; navBar1.AddGroup().Title = "我的电脑"; item = navBar1[1].AddItem(); item.ImageIndex = 3; item.Text = "C 盘"; navBar1.AddGroup().Title = "网上邻居"; item = navBar1[2].AddItem(); item.ImageIndex = 4; item.Text = "本地连接"; item = navBar1[2].AddItem(); item.ImageIndex = 5; item.Text = "VPN连接"; navBar1.AddGroup().Title = "我的文档"; item = navBar1[3].AddItem(); item.ImageIndex = 6; item.Text = "文档 A"; item = navBar1[3].AddItem(); item.ImageIndex = 7; item.Text = "文档 B"; item = navBar1[3].AddItem(); item.ImageIndex = 8; item.Text = "文档 C"; } }}
评论