推荐一个C# UI框架 ApeFree.ApeForms.TemplateNest
By
jerrxjr1220
at 2023-08-07 • 0人收藏 • 365人看过
一个国人开发的Winform UI框架,只需要修改很少的代码即可实现基本框架功能:
顶部导航栏、Logo图标栏、可折叠侧边栏、底边栏
using ApeFree.ApeForms.Core.Controls; using ApeFree.ApeForms.Demo; using System.Diagnostics; namespace picShow { public partial class MainForm : TemplateForm { public MainForm() { InitializeComponent(); } private void MainForm_Load(object sender, EventArgs e) { SideBarData = new List<NavBarGroup> { new NavBarGroup("Main Group 1") { new NavItem("Main Group 1 - Item 1", typeof(Form1)), new NavItem("Main Group 1 - Item 2", typeof(Form2)) }, new NavBarGroup("Main Group 2") { new NavItem("Main Group 2 - Item 1", typeof(Form1)), new NavItem("Main Group 2 - Item 2", typeof(Form2)) }, }; TopBarData = new List<TopBarItem> { new TopBarItem("Home", null), new TopBarItem("Link", (s, ex) => Process.Start("http://www.baidu.com")), }; LogoImage = new Bitmap("C:\\Users\\jianrui.xu\\Pictures\\Screenshots\\屏幕截图 2023-05-10 111314.png"); } protected override void LoadBottomBar(ControlListBox bottomBar) { base.LoadBottomBar(bottomBar); bottomBar.Items.Add(new Label() { Text = "CopyRight @ 2023", TextAlign = ContentAlignment.BottomCenter }); } } }
实现效果
整个ApeFree系列还要一套扁平化的UI:ApeFree.ApeForms.Forms,可参考官网文档进行调用。
登录后方可回帖