最新文章 (全部类别)
You must install .NET Desktop Runtime to run this application
Swagger生成API接口注释、参数注释、实体模型注释
Failed to load APl definition. response status is 500 /swagger/vl/swagger.json
.NET8/.NETCore 依赖接口注入:自动注入项目中所有接口和自定义类
CSFramework.EF应用 - ASP.NETCore/WebApi使用IDatabase动态代理创建多个数据库实例
CSFramework.EF数据库框架简介
EFCore查询数据报错:SqlNullValueException:“Data is Null. This method or property cannot be called on Null values
使用Photoshop PS制作GIF动画(等待窗体GIF图标)
C# Winform等待窗体WaitingForm组件下载(CSFramework提供)
使用VS2022升级助手将.NETFramework项目升级到.NET8/.NETCore
VS解决方案升级:.NETFramework升级到.NETCore(.NET6~.NET8)
CSFramework.COM C/S软件开发框架视频下载
CSFramework.Authentication 软件证书管理系统 - MAC地址管理
CSFramework.Authentication 软件证书管理系统 - 证书管理
CSFramework.Authentication 软件证书管理系统 - 制作软件授权证书
CSFrameworkV6快速开发框架 - SqlServer(MsSql)数据库测试报告
C/S架构软件开发平台 - 旗舰版V6 软件简介
C/S架构软件开发平台 - 旗舰版V6.1 - 新功能汇总
C/S客户端软件授权设计方案 - MAC地址白名单+软件到期时间授权
C/S客户端软件授权设计方案 - 在线用户并发数+软件到期时间授权
CSFramework.Authentication 软件授权证书管理系统
CSFrameworkV6旗舰版开发框架 - 集成软件授权认证系统
CSFrameworkV6旗舰版-新功能-在线用户查询、设置用户下线
CSFramework.Authentication 软件授权认证系统 - 软件测试报告
CSFrameworkV6旗舰版新功能-客户端软件授权(在线用户并发数+MAC白名单+软件到期时间)
特殊文本符号大全|Word中的特殊文本符号|图案符号
LINQ高级语法:使用ExecuteUpdate方法查询并批量更新数据(Where+Update)
C/S架构软件开发平台 - 旗舰版V6.0 - 底层框架迭代开发
DevExpress v24破解步骤
C#获取应用程序当前文件目录位置(安装路径)
SqlException: 列名 'Discriminator' 无效。
.NET C/S架构软件用户授权设计方案(mac地址+白名单用户)
B/S开发框架NuGet包、组件介绍
C/S框架软件产品客户案例
C/S架构软件开发平台 - 旗舰版V6.0 - 自动创建数据库备份计划
SqlServer自动备份计划,备份多个数据库,自动删除备份文件
CSFrameworkV6快速开发框架 - 两种报表数据源查询方式及优缺点
SqlServer使用xp_cmdshell删除备份文件
SqlServer备份数据库存储过程:p_BackupDB
IWebHostEnvironment接口怎么引用?
Docker Desktop使用指南(Windows操作系统)
VSCode开发工具使用笔记
本地源“C:\Program Files\DevExpress 22.2\Components\System\Components\Packages”不存在
CSFrameworkV6旗舰版-成功案例-合肥联宝MES系统
CSFrameworkV6旗舰版-成功案例-威海广泰MES系统
CSFrameworkV6软件开发框架+达梦数据库(国产数据库)测试报告
国产化软件设计:遵循信创要求,助力信息技术自主创新
DevExpress组件版本下载、安装与VS开发环境 - Winform C/S框架
CSFrameworkV6软件开发框架 - MySql数据库测试报告
CSFrameworkV6软件开发框架 - Oracle数据库测试报告
.net敏捷开发,创造卓越

[原创]超牛Outlook导航导控件(Outlook Navigation Panel)


  [原创]超牛Outlook导航导控件(Outlook Navigation Panel)[原创]超牛Outlook导航导控件(Outlook Navigation Panel)


1. Introduction

Who doesn’t know the Outlook Navigation Pane on the left side of the Outlook screen? Do you want to use the Navigation Pane in your project for free? Read on.



1.介绍

谁不知道位于Outlook主界面左侧的导航面板(Outlook Navigation Pane)? 你想不想在你的项目内使用免费的导航条控件?预知详情如何,下面详细分解!


(Outlook Navigation Panel)

贴图图片

2. Background

There is a lot of junk on the .NET market. Small study room projects being sold as large toolkits providing a bunch of crappy controls for a lot of money. To extend my portfolio and to give the open source community something back, I decided to make this control available free of charge. This control is also a note to control vendors, take your customers serious and provide valuable controls and support for their money. So enough preaching, let’s get cracking.


2.背景

.NET市场有很多不入流的垃圾作品, 一些小的工作室为了赚钱开发的工具包提供大量没啥价值的控件.
为了扩充我的原创作品并给予开源社区一些有价值的资料,我决定把这个控件免费提供给大家。
同时提醒某些控件供应商需要严格审查你们的客户, 要求他们提供一些有价值的控件. 否则骗了你的钱还云里雾里不知情!

好了,不讲这些大道理了,我们转入正题


Windows Form, the King is Dead??

I decided to create this control for Windows Forms to show the potential of Windows Forms. Windows Forms is not dead, because it performs betters and is responsive. WPF has a way to go. Besides that, you need a designer to design your controls, otherwise you’ll end up with a Christmas tree. 


Windows窗体,王者已死吗?

我决定编写这个控件用来证明Windows窗体的潜力, Windows Forms没有死,他性能优异且响应快速,但是WPF有很长的路要走。
除此之外,你需要一个专业的设计师来设计控件,否则你就像圣诞树一样老气横秋.

 

3. Structure of the Navigation Pane

In this section, I’ll briefly explain the basic objects of the Navigation Pane.


3.导航面板结构

在本节中简单介绍导航面板控件的基本对象。先看下图


 贴图图片

The Navigation Pane consist of bands, buttons and groups. The bands (2) are the basic object the Pane exists of. Each band is one to one linked to a button (1). The band is the container that comes to the front when the user clicks on one of the buttons. The band contains the other controls like the group (3). The bands can be expanded with groups which can be compared to the groups in Outlook. The Group is a control container which can be collapsed and expanded.


导航面板由区间(Bands),按钮(Button)及按钮分组(Group)组成。该区间(2)是面板控件(Panel)中的基本对象。
每个区间一对一对应一个按钮(1)。

按钮区实际上是一个容器(Container), 当用户点击导航面板中的一个按钮时会把这个容量显示有最前面。Band包括另一个控件如分组(3).

在Outlook中该区间(Bands)可以扩展显示当前按钮分组(Group)里的内容。 按钮分组是一个可以自由升缩的控件容器。


Button/Band

A button has three states, normal, when it’s hovered by the mouse and when it’s the active button or when the button is down.


按钮/区间

按钮有3种状态,正常,鼠标移动,活动状态


贴图图片

Group

A group have two states, either it’s expanded and all child controls are visible or it’s collapsed and only the header is visible.


贴图图片




组有两种状态,1.当组扩展后显示所组内所有的子控件。 2。当组收缩后仅显示组的标题。


 

4. Layout

The main class of the control (NaviBar) contains barely more than two collections containing the buttons and the bands. The most important intelligence is in the layout classes. The only thing the main class does is deciding when the layout process should be invoked. This is the layout engine principle. Explained in more depth here on MSDN.
贴图图片


4.布局(版面设计)

控件主类(NaviBar)至少容纳两个包含按钮和Bands的集合.  布局类是相当重要的类。主类最主要的工作是决定布局处理何时调用。
这是布局引擎的原则。更深入地解释请参考MSDN的文章


The layout process decides what control should be visible, active and at what position, etc. The advantage of this principle is that it’s really easy to implement a different layout without too much hassle, because the main control only knows that there is an layout but what it exactly does, he doesn’t care either. As long as it looks nice, like the toolbox in Visual Studio or like the Navigation pane in Outlook, or some other fancy view.

Renderers and Colortable

Separate classes are responsible for drawing the controls. The main class delegates like a lazy manager. The renderers are only responsible for drawing the objects, the colours are coming from separate classes, the colortables. If you are in a good mood, you can use flashy bright colors with a few lines of coding: 
 


控件着色及颜色表

系统设计应该分而治之,分离出来的类各尽其职,主类就像一个懒惰的经理代表, 渲染器仅仅负责绘制对象,颜色是由类颜色表(Colortables)指定的。如果你心情好,你可以使用下面这行代码给控件设置华丽明亮的颜色:


代码:


NaviButtonRenderer.ColorTable = FlashyColorTable;


This elegant principle is ripped away from the default .NET menus which are coming with Visual Studio.

5. Features

Here is a brief list of the features. To see the whole package, see the demo project.

Collapse

It’s possible to present the Navigation Pane in compact mode. Click on one of the small buttons on the top right of the header of the control. You can also collapse the Navigation Pane by setting the NaviBar.Collapsed property to true. If the end-user clicks on the collapsed bar, the band will popup on top of the other controls.


 收缩功能

点击控件头部右上角小图标可以隐藏或显示控件,或者设置NaviBar.Collapsed属性为true.


 

Layoutstyles

The Navigation Pane comes in six different flavors. Office 2007 is the main layout and for those who are stuck in the past, there is the Office 2003 look and feel. If you want to create a new colourstyle, you need to make an override of the NaviColorTable class.


布局样式

该导航条控件有6种不同风格的样式, 下图是Office 2003的外观样式. 如果你想创建一个新的颜色外观只要重写NaviColorTable类即可。


 
      Office 2007 Blue                      Office 2007 Black                Office 2007 Silver





Right to Left

This Navigation Pane is among the few who do support Right to left layout. Not much work when the layout has been defined in separate classes. It’s possible that not all features are like they should be. If one of the Arabics would like to test it and make me happy with the results?

Saving Settings




It’s possible for the end user to customize the layout. Like the ordering of the buttons or the visibility of the buttons. It’s possible to save the layout settings in an external data file. The details which are saved are the ordering of the buttons, the visibility of the buttons, the amount of visible buttons, the position of the splitter and whether the Pane is collapsed or not.

The settings are stored in the Settings property in the NaviBar class. To save these settings to a file, add a reference to Guifreaks.NavigationBar.XmlSerializers.dll. This DLL uses XML Serialization and is generated with sgen.exe for performance considerations. You as a developer are responsible for saving the settings to a data file of your preference. Here is a sample of saving the settings to an XML file.



控件设计存储在NaviBar类的Settins属性. 可以将设置保存在本地文件内, 添加引用Guifreaks.NavigationBar.XmlSerializers.dll
然后使用下面的代码:


if (saveFileDialogSettings.ShowDialog() == DialogResult.OK)
{
   try
   {
      string fileName = saveFileDialogSettings.FileName;
      NaviBarSettingsSerializer serial = new NaviBarSettingsSerializer();
      using (TextWriter w = new StreamWriter(fileName))
      {
         serial.Serialize(w, naviBar1.Settings);
      }
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }
}


You can use the same DLL to load the settings. After loading the settings, use the ApplySettings method in the NaviBar class to activate the settings.



if
(openFileDialogSettings.ShowDialog() == DialogResult.OK)
{
   try
   {
      string fileName = openFileDialogSettings.FileName;
      NaviBarSettingsSerializer serial = new NaviBarSettingsSerializer();
      using (StreamReader reader = new StreamReader(fileName))
      {
         NaviBarSettings settings = serial.Deserialize(reader) as NaviBarSettings;
         if (settings != null)
         {
            naviBar1.Settings = settings;
            naviBar1.ApplySettings();
         }
      }
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }
}



6. Samples

Here are a few basic code samples that should get you up running fast.

How to Add a New Group?

While you are into the designer, you can select the group from the toolbox and drag it into the band. Here is a code sample when you want to add a group from the source:

NaviGroup group = new NaviGroup();

group.Text = "test";
group.Expanded = true;
group.Dock = DockStyle.Top;

naviBand3.Controls.Add(group);


How to Add a New Band?

You can add a new band to the Navigation Pane using the NaviBar.Bands property. The small image appears when the button is presented in a horizontal way on the bottom. The large image appears when the buttons are presented horizontally as large buttons.

NaviBand band = new NaviBand();
band.Text = "NaviBand" + (naviBar1.Bands.Count + 1).ToString();
band.SmallImage = Properties.Resources.bookmark1;
band.LargeImage = Properties.Resources.bookmark;
naviBar1.Bands.Add(band);


How to Set the Layout?

The layout can be set using the NaviBar.Layout property.


naviBar1.LayoutStyle = NaviLayoutStyle.Office2003Silver;


How to Activate a Band?

Making a particular band the active band is fairly simple:


naviBar1.ActiveBand = naviBar1.Bands[0];



原文: http://www.codeproject.com/KB/menus/NaviPane.aspx


本文来源:



C/S框架网|原创精神.创造价值.打造精品


扫一扫加作者微信
C/S框架网作者微信 C/S框架网|原创作品.质量保障.竭诚为您服务

版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
C/S框架网
上一篇:C#中处理全局鼠标及键盘勾子
下一篇:C# ImageListView控件下载(源代码)
评论列表

发表评论

评论内容
昵称:
关联文章

[]Outlook导航(Outlook Navigation Panel)
Winform布局开源框架,Winform框架,插化框架|C/S框架网
[]递归读取DataTable加载TreeList
C# Winfom、窗体、Panel拖动缩放、移动位置通用类(ControlMoveTool.cs)
[]无线监控系统之二-------C#实现(续)
】C# Winform Dev自动下拉弹框筛选数据PopupContainerEdit组
C#.Net自定义 - GridPopupContainerEdit
Dev表格RepositoryItemLookUpEdit组改变值时设置其它列的值-
JS日期
使用Scheduler实现生产进度监控程序
ExRichTextEdit 下载
C/S架构开源软件 - C#.NET+Winform+Dev+SQL快速开发框架
.NET RichTextBox使用详解
DevExpress 通过小三角图标变更类型
CSFrameworkV6旗舰版-、组件命名规范
ucWindowTitle用户 - 用户界面规范
[]Asp.Net的GridView绑定空数据显示标题
WinFramework轻量级开发框架 - LayoutControl界面自适应
NavBarControl 组添加一个导航菜单(Add Group)
C#.Net局域网版本自动升级解决方案()

热门标签
软件著作权登记证书 .NET Reactor .NET5 .NET6 .NET7 .NET8 .NETFramework APP AspNetCore Auth-软件授权注册系统 Axios B/S B/S开发框架 B/S框架 BSFramework Bug Bug记录 C#加密解密 C#源码 C/S CHATGPT CMS系统 CodeGenerator CSFramework.DB CSFramework.EF CSFrameworkV1学习版 CSFrameworkV2标准版 CSFrameworkV3高级版 CSFrameworkV4企业版 CSFrameworkV5旗舰版 CSFrameworkV6.0 CSFrameworkV6.1 CSFrameworkV6旗舰版 DAL数据访问层 Database datalock DbFramework Demo教学 Demo实例 Demo下载 DevExpress教程 Docker Desktop DOM EFCore EF框架 Element-UI EntityFramework ERP ES6 Excel FastReport GIT HR IDatabase IIS JavaScript LINQ MES MiniFramework MIS MySql NavBarControl NETCore Node.JS NPM OMS Oracle资料 ORM PaaS POS Promise API PSD RedGet Redis SAP Schema SEO SEO文章 SQL SQLConnector SqlServer Swagger TMS系统 Token令牌 VS2022 VSCode VS升级 VUE WCF WebApi WebApi NETCore WebApi框架 WEB开发框架 Windows服务 Winform 开发框架 Winform 开发平台 WinFramework Workflow工作流 Workflow流程引擎 XtraReport 安装环境 版本区别 报表 备份还原 踩坑日记 操作手册 达梦数据库 代码生成器 迭代开发记录 功能介绍 国际化 基础资料窗体 架构设计 角色权限 开发sce 开发工具 开发技巧 开发教程 开发框架 开发平台 开发指南 客户案例 快速搭站系统 快速开发平台 框架升级 毛衫行业ERP 秘钥 密钥 权限设计 软件报价 软件测试报告 软件加壳 软件简介 软件开发框架 软件开发平台 软件开发文档 软件授权 软件体系架构 软件下载 软件著作权登记证书 软著证书 三层架构 设计模式 生成代码 实用小技巧 视频下载 收钱音箱 数据锁 数据同步 微信小程序 未解决问题 文档下载 喜鹊ERP 喜鹊软件 系统对接 详细设计说明书 新功能 信创 行政区域数据库 需求分析 疑难杂症 蝇量级框架 蝇量框架 用户管理 用户开发手册 用户控件 在线支付 纸箱ERP 智能语音收款机 自定义窗体 自定义组件 自动升级程序
联系我们
联系电话:13923396219(微信同号)
电子邮箱:23404761@qq.com
站长微信二维码
微信二维码