syncfusion-winforms-navigation-pane
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImplementing Navigation Panes (GroupBar) in Syncfusion WinForms
在Syncfusion WinForms中实现导航窗格(GroupBar)
This skill guides you in implementing Syncfusion WinForms GroupBar (Navigation Pane) control—an Outlook-style navigation container that displays hierarchical groups with collapsible sections and child item collections.
本指南将教你实现Syncfusion WinForms GroupBar(导航窗格)控件,这是一种Outlook风格的导航容器,支持展示带可折叠区域和子项集合的层级分组。
When to Use This Skill
什么时候使用本指南
Use this skill when the user needs to:
- Implement Outlook-style navigation panes (similar to Microsoft Outlook sidebar)
- Create hierarchical sidebar navigation with collapsible groups
- Build toolbox-style interfaces (like Visual Studio .NET toolbox)
- Add categorized control collections with GroupBarItems
- Implement GroupView for displaying child items within groups
- Enable StackedMode for navigation pane at bottom (Outlook-style)
- Apply Office 2007/2010/2016 themes and Metro styles
- Create nested GroupBar (GroupBar within GroupBar)
- Add in-place renaming of navigation items
- Implement serialization to save/restore navigation layout
- Customize headers, borders, colors, and animations
- Replace standard panels with themed navigation containers
GroupBar is ideal for applications requiring categorized navigation, toolbox-style interfaces, or Outlook-inspired sidebar layouts.
当用户需要实现以下需求时可以使用本指南:
- 实现Outlook风格导航窗格(类似Microsoft Outlook侧边栏)
- 创建带可折叠分组的层级侧边栏导航
- 搭建工具箱风格界面(类似Visual Studio .NET工具箱)
- 用GroupBarItem添加分类控件集合
- 实现GroupView来展示分组内的子项
- 启用StackedMode(堆叠模式)实现底部导航窗格(Outlook风格)
- 应用Office 2007/2010/2016主题和Metro风格
- 创建嵌套GroupBar(GroupBar中嵌套GroupBar)
- 为导航项添加就地重命名功能
- 实现序列化来保存/恢复导航布局
- 自定义头部、边框、颜色和动画
- 用带主题的导航容器替换标准面板
GroupBar非常适合需要分类导航、工具箱风格界面或Outlook风格侧边栏布局的应用。
Component Overview
组件概述
GroupBar (Navigation Pane) is a container control that displays multiple groups (GroupBarItems) where only one selected group's content is visible at a time. It works with GroupView to display child items. Key capabilities:
- GroupBarItem: Tab-like navigation items (groups/categories)
- GroupView: Client control for displaying child items within groups
- GroupViewItem: Individual child items within a GroupView
- StackedMode: Navigation pane mode (like Outlook) with collapsible stack
- Office Themes: Office 2007/2010/2016, Metro, Office2016Colorful/White/DarkGray/Black
- Nested GroupBar: Host GroupBar within another GroupBar
- Serialization: Save/restore layout state and item positions
- Customizable Appearance: Headers, borders, colors, fonts, animations
- In-Place Renaming: Edit GroupBarItem names at runtime
- Localization: Multi-language support
Key Difference from Standard Panel/TabControl:
GroupBar provides Outlook-style navigation with GroupView integration, StackedMode for collapsible navigation pane, Office themes, and hierarchical item display capabilities.
GroupBar(导航窗格)是一种容器控件,可展示多个分组(GroupBarItem),同一时间仅展示选中分组的内容。它与GroupView配合使用来展示子项,核心能力包括:
- GroupBarItem:类似标签的导航项(分组/分类)
- GroupView:用于展示分组内子项的客户端控件
- GroupViewItem:GroupView中的单个子项
- StackedMode:导航窗格模式(类似Outlook),支持可折叠堆叠
- Office主题:Office 2007/2010/2016、Metro、Office2016彩色/白色/深灰/黑色
- 嵌套GroupBar:支持在GroupBar中嵌套另一个GroupBar
- 序列化:保存/恢复布局状态和项位置
- 可自定义外观:头部、边框、颜色、字体、动画
- 就地重命名:运行时可编辑GroupBarItem名称
- 本地化:多语言支持
与标准面板/TabControl的核心区别:
GroupBar提供Outlook风格导航,支持GroupView集成、StackedMode可折叠导航窗格、Office主题和层级项展示能力。
Documentation and Navigation Guide
文档和导航指南
Getting Started and Basic Setup
入门与基础配置
📄 Read: references/getting-started.md
Read this reference when users need:
- Assembly dependencies and NuGet package installation
- Namespace: Syncfusion.Windows.Forms.Tools
- Creating GroupBar via designer or code
- Adding GroupBarItems to the control
- Basic GroupBar configuration
- Understanding GroupBar structure
- Complete minimal working example
📄 阅读: references/getting-started.md
当用户需要以下内容时阅读该参考:
- 程序集依赖和NuGet包安装
- 命名空间:Syncfusion.Windows.Forms.Tools
- 通过设计器或代码创建GroupBar
- 向控件添加GroupBarItem
- GroupBar基础配置
- 理解GroupBar结构
- 完整的最小可用示例
GroupBar Items and Structure
GroupBar项和结构
📄 Read: references/groupbar-items-and-structure.md
Read this reference when users need:
- Creating GroupBarItem instances
- Text property for item labels
- Image property for item icons
- Client property (linking to GroupView)
- GroupBarItems collection management
- Item selection and navigation
- GroupBarItemSelected event handling
- Complete group navigation examples
📄 阅读: references/groupbar-items-and-structure.md
当用户需要以下内容时阅读该参考:
- 创建GroupBarItem实例
- 用于项标签的Text属性
- 用于项图标的Image属性
- Client属性(关联到GroupView)
- GroupBarItems集合管理
- 项选择和导航
- GroupBarItemSelected事件处理
- 完整的分组导航示例
GroupView and Child Items
GroupView和子项
📄 Read: references/groupview-and-child-items.md
Read this reference when users need:
- GroupView overview (client control for groups)
- Creating GroupView instances
- GroupViewItem for child items
- Adding items to GroupViewItems collection
- Linking GroupView to GroupBarItem.Client
- Item selection in GroupView
- GroupViewItem click events
- Building toolbox-style interfaces
📄 阅读: references/groupview-and-child-items.md
当用户需要以下内容时阅读该参考:
- GroupView概述(分组的客户端控件)
- 创建GroupView实例
- 用于子项的GroupViewItem
- 向GroupViewItems集合添加项
- 将GroupView关联到GroupBarItem.Client
- GroupView中的项选择
- GroupViewItem点击事件
- 搭建工具箱风格界面
Stacked Mode (Navigation Pane)
堆叠模式(导航窗格)
📄 Read: references/stacked-mode.md
Read this reference when users need:
- StackedMode property (Outlook-style navigation)
- Navigation pane at bottom
- HeaderHeight property for collapsed state
- Navigation between stacked items
- Expanded/collapsed state management
- Serialization of stacked layout
- Complete Outlook clone example
📄 阅读: references/stacked-mode.md
当用户需要以下内容时阅读该参考:
- StackedMode属性(Outlook风格导航)
- 底部导航窗格
- 折叠状态的HeaderHeight属性
- 堆叠项之间的导航
- 展开/折叠状态管理
- 堆叠布局的序列化
- 完整的Outlook复刻示例
Visual Styles and Themes
视觉样式和主题
📄 Read: references/visual-styles-and-themes.md
Read this reference when users need:
- VisualStyle property overview
- Office2007 theme (Blue, Silver, Black, Managed)
- Office2007Outlook theme
- Office2010 theme (Blue, Silver, Black, Managed)
- Metro theme
- Office2016 themes (Colorful, White, DarkGray, Black)
- Managed colors for custom branding
- Theme comparison and selection
- Applying themes at runtime
📄 阅读: references/visual-styles-and-themes.md
当用户需要以下内容时阅读该参考:
- VisualStyle属性概述
- Office2007主题(蓝色、银色、黑色、自定义)
- Office2007Outlook主题
- Office2010主题(蓝色、银色、黑色、自定义)
- Metro主题
- Office2016主题(彩色、白色、深灰、黑色)
- 用于自定义品牌的自定义颜色
- 主题对比和选择
- 运行时应用主题
Appearance Customization
外观自定义
📄 Read: references/appearance-customization.md
Read this reference when users need:
- Header customization (colors, fonts, height)
- Border settings (styles, colors)
- Text alignment and settings
- Image display configuration
- Tooltip settings
- Cursor customization
- Animation settings
- Custom colors and gradients
📄 阅读: references/appearance-customization.md
当用户需要以下内容时阅读该参考:
- 头部自定义(颜色、字体、高度)
- 边框设置(样式、颜色)
- 文本对齐和设置
- 图片展示配置
- 提示框设置
- 光标自定义
- 动画设置
- 自定义颜色和渐变
Advanced Features and Configuration
高级功能和配置
📄 Read: references/advanced-features.md
Read this reference when users need:
- Nested GroupBar support (GroupBar in GroupBar)
- In-place renaming of GroupBarItems
- Serialization of layout state
- Localization support
- Link selection in GroupView
- Custom control hosting
- Event handling (GroupBarItemSelected, etc.)
- Complex navigation scenarios
📄 阅读: references/advanced-features.md
当用户需要以下内容时阅读该参考:
- 嵌套GroupBar支持(GroupBar中嵌套GroupBar)
- GroupBarItem就地重命名
- 布局状态序列化
- 本地化支持
- GroupView中的链接选择
- 自定义控件托管
- 事件处理(GroupBarItemSelected等)
- 复杂导航场景
Quick Start Example
快速入门示例
Here's a minimal example creating a GroupBar with items and child content:
csharp
using Syncfusion.Windows.Forms.Tools;
using System;
using System.Drawing;
using System.Windows.Forms;
public class GroupBarExample : Form
{
private GroupBar groupBar1;
public GroupBarExample()
{
// Create GroupBar
groupBar1 = new GroupBar();
groupBar1.Dock = DockStyle.Left;
groupBar1.Width = 200;
// Create GroupBarItems
GroupBarItem mailItem = new GroupBarItem();
mailItem.Text = "Mail";
GroupBarItem calendarItem = new GroupBarItem();
calendarItem.Text = "Calendar";
GroupBarItem contactsItem = new GroupBarItem();
contactsItem.Text = "Contacts";
// Add items to GroupBar
groupBar1.GroupBarItems.AddRange(new GroupBarItem[] {
mailItem,
calendarItem,
contactsItem
});
// Add GroupBar to form
this.Controls.Add(groupBar1);
this.Text = "GroupBar Example";
this.Size = new Size(600, 400);
}
}Result: A left-docked navigation pane with 3 groups (Mail, Calendar, Contacts) similar to Microsoft Outlook.
以下是创建带项和子内容的GroupBar的最小示例:
csharp
using Syncfusion.Windows.Forms.Tools;
using System;
using System.Drawing;
using System.Windows.Forms;
public class GroupBarExample : Form
{
private GroupBar groupBar1;
public GroupBarExample()
{
// Create GroupBar
groupBar1 = new GroupBar();
groupBar1.Dock = DockStyle.Left;
groupBar1.Width = 200;
// Create GroupBarItems
GroupBarItem mailItem = new GroupBarItem();
mailItem.Text = "Mail";
GroupBarItem calendarItem = new GroupBarItem();
calendarItem.Text = "Calendar";
GroupBarItem contactsItem = new GroupBarItem();
contactsItem.Text = "Contacts";
// Add items to GroupBar
groupBar1.GroupBarItems.AddRange(new GroupBarItem[] {
mailItem,
calendarItem,
contactsItem
});
// Add GroupBar to form
this.Controls.Add(groupBar1);
this.Text = "GroupBar Example";
this.Size = new Size(600, 400);
}
}效果: 一个停靠在左侧的导航窗格,包含3个分组(邮件、日历、联系人),类似Microsoft Outlook。
Common Patterns
常见模式
Outlook-Style Navigation with GroupView
带GroupView的Outlook风格导航
Pattern: Create an Outlook-inspired navigation pane with child items.
csharp
// Create GroupBar
GroupBar groupBar = new GroupBar();
groupBar.Dock = DockStyle.Left;
groupBar.Width = 220;
groupBar.VisualStyle = VisualStyle.Office2016Colorful;
// Create GroupBarItem
GroupBarItem mailItem = new GroupBarItem();
mailItem.Text = "Mail Folders";
// Create GroupView for child items
GroupView mailView = new GroupView();
mailView.Name = "MailView";
mailView.GroupViewItems.AddRange(new GroupViewItem[] {
new GroupViewItem("Inbox", 0, true, null, "Inbox"),
new GroupViewItem("Drafts", 1, true, null, "Drafts"),
new GroupViewItem("Sent Items", 2, true, null, "Sent"),
new GroupViewItem("Deleted Items", 3, true, null, "Deleted")
});
// Link GroupView to GroupBarItem
mailItem.Client = mailView;
groupBar.Controls.Add(mailView);
groupBar.GroupBarItems.Add(mailItem);
// Handle item click
mailView.GroupViewItemSelected += (s, e) => {
string folderName = e.Item.Text;
LoadMailFolder(folderName);
};
this.Controls.Add(groupBar);When: User needs Outlook-style mail navigation with folder hierarchy.
模式: 创建带子项的Outlook风格导航窗格。
csharp
// Create GroupBar
GroupBar groupBar = new GroupBar();
groupBar.Dock = DockStyle.Left;
groupBar.Width = 220;
groupBar.VisualStyle = VisualStyle.Office2016Colorful;
// Create GroupBarItem
GroupBarItem mailItem = new GroupBarItem();
mailItem.Text = "Mail Folders";
// Create GroupView for child items
GroupView mailView = new GroupView();
mailView.Name = "MailView";
mailView.GroupViewItems.AddRange(new GroupViewItem[] {
new GroupViewItem("Inbox", 0, true, null, "Inbox"),
new GroupViewItem("Drafts", 1, true, null, "Drafts"),
new GroupViewItem("Sent Items", 2, true, null, "Sent"),
new GroupViewItem("Deleted Items", 3, true, null, "Deleted")
});
// Link GroupView to GroupBarItem
mailItem.Client = mailView;
groupBar.Controls.Add(mailView);
groupBar.GroupBarItems.Add(mailItem);
// Handle item click
mailView.GroupViewItemSelected += (s, e) => {
string folderName = e.Item.Text;
LoadMailFolder(folderName);
};
this.Controls.Add(groupBar);适用场景: 用户需要带文件夹层级的Outlook风格邮件导航。
Visual Studio Toolbox Clone
Visual Studio工具箱复刻
Pattern: Create a toolbox-style interface with categorized controls.
csharp
// Create GroupBar for toolbox
GroupBar toolbox = new GroupBar();
toolbox.Dock = DockStyle.Left;
toolbox.Width = 200;
toolbox.VisualStyle = VisualStyle.Office2010;
// Create "Windows Forms" category
GroupBarItem winFormsItem = new GroupBarItem();
winFormsItem.Text = "Windows Forms";
GroupView winFormsView = new GroupView();
winFormsView.GroupViewItems.AddRange(new GroupViewItem[] {
new GroupViewItem("Button", 0, true, null, "Button"),
new GroupViewItem("TextBox", 1, true, null, "TextBox"),
new GroupViewItem("Label", 2, true, null, "Label"),
new GroupViewItem("ComboBox", 3, true, null, "ComboBox")
});
// Create "Data" category
GroupBarItem dataItem = new GroupBarItem();
dataItem.Text = "Data";
GroupView dataView = new GroupView();
dataView.GroupViewItems.AddRange(new GroupViewItem[] {
new GroupViewItem("DataSet", 0, true, null, "DataSet"),
new GroupViewItem("DataTable", 1, true, null, "DataTable"),
new GroupViewItem("BindingSource", 2, true, null, "BindingSource")
});
// Link and add
winFormsItem.Client = winFormsView;
dataItem.Client = dataView;
toolbox.Controls.Add(winFormsView);
toolbox.Controls.Add(dataView);
toolbox.GroupBarItems.Add(winFormsItem);
toolbox.GroupBarItems.Add(dataItem);
this.Controls.Add(toolbox);When: User needs a categorized toolbox with collapsible sections like Visual Studio.
模式: 创建带分类控件的工具箱风格界面。
csharp
// Create GroupBar for toolbox
GroupBar toolbox = new GroupBar();
toolbox.Dock = DockStyle.Left;
toolbox.Width = 200;
toolbox.VisualStyle = VisualStyle.Office2010;
// Create "Windows Forms" category
GroupBarItem winFormsItem = new GroupBarItem();
winFormsItem.Text = "Windows Forms";
GroupView winFormsView = new GroupView();
winFormsView.GroupViewItems.AddRange(new GroupViewItem[] {
new GroupViewItem("Button", 0, true, null, "Button"),
new GroupViewItem("TextBox", 1, true, null, "TextBox"),
new GroupViewItem("Label", 2, true, null, "Label"),
new GroupViewItem("ComboBox", 3, true, null, "ComboBox")
});
// Create "Data" category
GroupBarItem dataItem = new GroupBarItem();
dataItem.Text = "Data";
GroupView dataView = new GroupView();
dataView.GroupViewItems.AddRange(new GroupViewItem[] {
new GroupViewItem("DataSet", 0, true, null, "DataSet"),
new GroupViewItem("DataTable", 1, true, null, "DataTable"),
new GroupViewItem("BindingSource", 2, true, null, "BindingSource")
});
// Link and add
winFormsItem.Client = winFormsView;
dataItem.Client = dataView;
toolbox.Controls.Add(winFormsView);
toolbox.Controls.Add(dataView);
toolbox.GroupBarItems.Add(winFormsItem);
toolbox.GroupBarItems.Add(dataItem);
this.Controls.Add(toolbox);适用场景: 用户需要类似Visual Studio的带可折叠区域的分类工具箱。
Stacked Navigation Pane (Outlook Mode)
堆叠导航窗格(Outlook模式)
Pattern: Enable Outlook-style stacked navigation with bottom pane.
csharp
// Create GroupBar in stacked mode
GroupBar navPane = new GroupBar();
navPane.Dock = DockStyle.Left;
navPane.Width = 220;
navPane.StackedMode = true; // Enable Outlook-style navigation
navPane.VisualStyle = VisualStyle.Office2016White;
// Create multiple GroupBarItems
GroupBarItem mailItem = new GroupBarItem();
mailItem.Text = "Mail";
GroupBarItem calendarItem = new GroupBarItem();
calendarItem.Text = "Calendar";
GroupBarItem contactsItem = new GroupBarItem();
contactsItem.Text = "Contacts";
GroupBarItem tasksItem = new GroupBarItem();
tasksItem.Text = "Tasks";
// Add all items
navPane.GroupBarItems.AddRange(new GroupBarItem[] {
mailItem,
calendarItem,
contactsItem,
tasksItem
});
// Handle item selection
navPane.GroupBarItemSelected += (s, e) => {
string selectedSection = e.Item.Text;
LoadSection(selectedSection);
};
this.Controls.Add(navPane);When: User needs Outlook-style navigation with stacked items and bottom navigation pane.
模式: 启用带底部窗格的Outlook风格堆叠导航。
csharp
// Create GroupBar in stacked mode
GroupBar navPane = new GroupBar();
navPane.Dock = DockStyle.Left;
navPane.Width = 220;
navPane.StackedMode = true; // Enable Outlook-style navigation
navPane.VisualStyle = VisualStyle.Office2016White;
// Create multiple GroupBarItems
GroupBarItem mailItem = new GroupBarItem();
mailItem.Text = "Mail";
GroupBarItem calendarItem = new GroupBarItem();
calendarItem.Text = "Calendar";
GroupBarItem contactsItem = new GroupBarItem();
contactsItem.Text = "Contacts";
GroupBarItem tasksItem = new GroupBarItem();
tasksItem.Text = "Tasks";
// Add all items
navPane.GroupBarItems.AddRange(new GroupBarItem[] {
mailItem,
calendarItem,
contactsItem,
tasksItem
});
// Handle item selection
navPane.GroupBarItemSelected += (s, e) => {
string selectedSection = e.Item.Text;
LoadSection(selectedSection);
};
this.Controls.Add(navPane);适用场景: 用户需要带堆叠项和底部导航窗格的Outlook风格导航。
Key Properties
核心属性
Core Properties
基础属性
| Property | Type | Description | When to Use |
|---|---|---|---|
| Collection | Collection of GroupBarItem instances | Add navigation groups |
| GroupBarItem | Currently selected item | Get/set active group |
| bool | Enable Outlook-style stacked navigation | Outlook-like layout |
| VisualStyle | Visual theme | Apply Office themes |
| int | Height of GroupBar header | Customize header size |
| 属性 | 类型 | 描述 | 使用场景 |
|---|---|---|---|
| 集合 | GroupBarItem实例的集合 | 添加导航分组 |
| GroupBarItem | 当前选中的项 | 获取/设置激活分组 |
| bool | 启用Outlook风格堆叠导航 | Outlook类布局 |
| VisualStyle | 视觉主题 | 应用Office主题 |
| int | GroupBar头部高度 | 自定义头部尺寸 |
GroupBarItem Properties
GroupBarItem属性
| Property | Type | Description | When to Use |
|---|---|---|---|
| string | Item display text | Set group label |
| Image | Item icon image | Add visual identifier |
| Control | Client control (typically GroupView) | Link content to item |
| bool | Whether item is selected | Check/set selection |
| 属性 | 类型 | 描述 | 使用场景 |
|---|---|---|---|
| string | 项展示文本 | 设置分组标签 |
| Image | 项图标图片 | 添加视觉标识 |
| Control | 客户端控件(通常是GroupView) | 关联内容到项 |
| bool | 项是否被选中 | 检查/设置选中状态 |
GroupView Properties
GroupView属性
| Property | Type | Description | When to Use |
|---|---|---|---|
| Collection | Child items in the view | Add child items |
| GroupViewItem | Currently selected child | Get/set selected child |
| string | Identifier for the view | Reference the view |
| 属性 | 类型 | 描述 | 使用场景 |
|---|---|---|---|
| 集合 | 视图中的子项 | 添加子项 |
| GroupViewItem | 当前选中的子项 | 获取/设置选中子项 |
| string | 视图标识符 | 引用视图 |
Styling Properties
样式属性
| Property | Type | Description | When to Use |
|---|---|---|---|
| VisualStyle | Theme (Office2007/2010/2016/Metro) | Apply themes |
| Office2007Theme | Office2007 color scheme | Blue/Silver/Black/Managed |
| Office2010Theme | Office2010 color scheme | Blue/Silver/Black/Managed |
| BorderStyle | Border appearance | Customize borders |
| Color | Background color | Custom backgrounds |
| 属性 | 类型 | 描述 | 使用场景 |
|---|---|---|---|
| VisualStyle | 主题(Office2007/2010/2016/Metro) | 应用主题 |
| Office2007Theme | Office2007配色方案 | 蓝色/银色/黑色/自定义 |
| Office2010Theme | Office2010配色方案 | 蓝色/银色/黑色/自定义 |
| BorderStyle | 边框外观 | 自定义边框 |
| Color | 背景颜色 | 自定义背景 |
Advanced Properties
高级属性
| Property | Type | Description | When to Use |
|---|---|---|---|
| bool | Allow collapsing groups | Enable collapse behavior |
| bool | Enable item renaming | Runtime editing |
| bool | Animate collapse/expand | Smooth transitions |
| bool | Display tooltips | Show item descriptions |
| 属性 | 类型 | 描述 | 使用场景 |
|---|---|---|---|
| bool | 允许折叠分组 | 启用折叠行为 |
| bool | 启用项重命名 | 运行时编辑 |
| bool | 折叠/展开动画 | 平滑过渡 |
| bool | 展示提示框 | 展示项描述 |
Common Use Cases
常见用例
Email Client Navigation
邮件客户端导航
Outlook-style navigation with mail folders:
- Mail folders (Inbox, Drafts, Sent, Deleted)
- Calendar view with appointments
- Contacts list with categories
- Tasks with priority sections
带邮件文件夹的Outlook风格导航:
- 邮件文件夹(收件箱、草稿箱、已发送、已删除)
- 带日程的日历视图
- 带分类的联系人列表
- 带优先级分区的任务
IDE Toolbox Interfaces
IDE工具箱界面
Visual Studio-style toolboxes:
- Categorized control collections
- Component categories (Data, Layout, Controls)
- Collapsible sections
- Drag-drop tool selection
Visual Studio风格工具箱:
- 分类控件集合
- 组件分类(数据、布局、控件)
- 可折叠区域
- 拖拽工具选择
Document Management Systems
文档管理系统
Hierarchical document navigation:
- Document categories and folders
- Project hierarchies
- File type groupings
- Archive sections
层级文档导航:
- 文档分类和文件夹
- 项目层级
- 文件类型分组
- 归档分区
Settings and Configuration Panels
设置和配置面板
Categorized settings navigation:
- General settings section
- Account preferences
- Advanced options
- Theme customization
分类设置导航:
- 通用设置分区
- 账户偏好
- 高级选项
- 主题自定义
Implementation Checklist
实现检查清单
When implementing GroupBar (Navigation Pane), ensure:
- ✅ Required assemblies referenced (Syncfusion.Shared.Base.dll)
- ✅ Namespace included (Syncfusion.Windows.Forms.Tools)
- ✅ GroupBar instance created and configured
- ✅ GroupBarItems added to GroupBarItems collection
- ✅ GroupView created if displaying child items
- ✅ Client property set to link GroupView to GroupBarItem
- ✅ Visual style applied (VisualStyle property)
- ✅ Dock property set for proper layout (typically DockStyle.Left)
- ✅ Event handlers added for item selection
- ✅ Testing with multiple items and navigation
实现GroupBar(导航窗格)时,请确保:
- ✅ 已引用所需程序集(Syncfusion.Shared.Base.dll)
- ✅ 已引入命名空间(Syncfusion.Windows.Forms.Tools)
- ✅ 已创建并配置GroupBar实例
- ✅ 已将GroupBarItem添加到GroupBarItems集合
- ✅ 如需展示子项已创建GroupView
- ✅ 已设置Client属性将GroupView关联到GroupBarItem
- ✅ 已应用视觉样式(VisualStyle属性)
- ✅ 已设置Dock属性实现合理布局(通常是DockStyle.Left)
- ✅ 已为项选择添加事件处理函数
- ✅ 已通过多个项和导航完成测试
Troubleshooting Quick Reference
故障排查快速参考
Issue: GroupBar not visible
- Check if GroupBar is added to form's Controls
- Set Dock property (DockStyle.Left recommended)
- Verify Width property is sufficient (200-250 pixels typical)
- Ensure form has space for docked control
Issue: GroupBarItems not appearing
- Verify items are added to GroupBarItems collection
- Check Text property is set on each item
- Ensure GroupBar.Visible = true
- Verify items are not collapsed/hidden
Issue: Child items (GroupViewItems) not displaying
- Create GroupView instance
- Add GroupViewItems to GroupView.GroupViewItems collection
- Set GroupBarItem.Client = groupView
- Add GroupView to GroupBar.Controls collection
Issue: StackedMode not working
- Set StackedMode = true
- Ensure multiple GroupBarItems exist (need 2+ for stacking)
- Check HeaderHeight property (0 hides header)
- Verify visual style supports stacked mode
Issue: Theme not applying
- Set VisualStyle property to desired theme
- For Office2007/2010, set corresponding theme property (Office2007Theme, Office2010Theme)
- For managed colors, call ApplyManagedColors method
- Ensure Syncfusion.Shared.Base assembly is referenced
Issue: GroupView selection not working
- Handle GroupViewItemSelected event
- Check GroupView.SelectedItem property
- Ensure GroupViewItems have unique identifiers
- Verify click events are wired up
问题: GroupBar不可见
- 检查GroupBar是否已添加到窗体的Controls集合
- 设置Dock属性(推荐DockStyle.Left)
- 确认Width属性足够(通常200-250像素)
- 确保窗体有足够空间容纳停靠控件
问题: GroupBarItem不展示
- 确认项已添加到GroupBarItems集合
- 检查每个项的Text属性是否已设置
- 确保GroupBar.Visible = true
- 确认项未被折叠/隐藏
问题: 子项(GroupViewItem)不展示
- 已创建GroupView实例
- 已将GroupViewItem添加到GroupView.GroupViewItems集合
- 已设置GroupBarItem.Client = groupView
- 已将GroupView添加到GroupBar.Controls集合
问题: StackedMode不生效
- 设置StackedMode = true
- 确保存在多个GroupBarItem(至少2个才能堆叠)
- 检查HeaderHeight属性(0会隐藏头部)
- 确认视觉样式支持堆叠模式
问题: 主题不生效
- 将VisualStyle属性设置为目标主题
- 对于Office2007/2010,设置对应的主题属性(Office2007Theme、Office2010Theme)
- 自定义颜色请调用ApplyManagedColors方法
- 确保已引用Syncfusion.Shared.Base程序集
问题: GroupView选择不生效
- 处理GroupViewItemSelected事件
- 检查GroupView.SelectedItem属性
- 确保GroupViewItem有唯一标识符
- 确认点击事件已正确绑定
Summary
总结
GroupBar (Navigation Pane) provides Outlook-style navigation functionality with:
- Hierarchical Navigation: GroupBarItem groups with GroupView child items
- Stacked Mode: Outlook-style navigation pane with collapsible sections
- Office Themes: Office 2007/2010/2016, Metro, and custom themes
- Nested Support: GroupBar within GroupBar capability
- Serialization: Save/restore layout state
- Customizable Appearance: Headers, borders, colors, animations
Use GroupBar when Outlook-style navigation, toolbox interfaces, categorized hierarchies, or themed navigation containers are needed for creating professional and organized WinForms applications.
GroupBar(导航窗格)提供Outlook风格导航功能,具备以下特性:
- 层级导航:GroupBarItem分组搭配GroupView子项
- 堆叠模式:Outlook风格导航窗格,支持可折叠区域
- Office主题:Office 2007/2010/2016、Metro和自定义主题
- 嵌套支持:支持GroupBar嵌套GroupBar
- 序列化:保存/恢复布局状态
- 可自定义外观:头部、边框、颜色、动画
当你需要为WinForms应用开发Outlook风格导航、工具箱界面、分类层级或带主题的导航容器,打造专业有序的应用时,可以使用GroupBar。