当前位置: 首页 > news >正文

Application UI

 本节包含关于如何用DevExpress控件模拟许多流行的应用程序ui的教程。

Windows 11 UI

Windows 11和最新一代微软Office产品启发的UI。

Office Inspired UI

Word、Excel、PowerPoint和Visio等微软Office应用程序启发的UI。

如何:手动构建Office风格的UI

本教程演示如何构建一个典型的受Office启发的UI,如下所示。请注意,您还可以使用Template Gallery来构建相同的UI类型。

  1. In Visual Studio, go to “File | New | Project” or press CTRL+SHIFT+N to create a new project. Select the default Visual Studio “Windows Forms Application” template and click OK.
  2. Use the Visual Studio Toolbox to add Navigation Frame, Navigation Bar and Office Navigation Bar controls to your form.

  3. Arrange the controls as illustrated below.  

  4. Use the Navigation Bar smart tag to switch the bar to the Navigation Pane View.

  5. Change captions for automatically created NavBarGroup and NavigationPage controls to “Employees” and “Customers”. Assign the same text strings to the Tag property of both pages, as demonstrated in the code below.

    navigationPage1.Tag = navBarGroup1.Caption = navigationPage1.Caption = "Employees";
    navigationPage2.Tag = navBarGroup2.Caption = navigationPage2.Caption = "Customers";

  6. Click the Navigation Frame’s chevron buttons to select different pages and drop a LabelControl on each page, then customize label captions. At runtime, these labels will allow you to identify Navigation Frame pages.

  7. Use the Office Navigation Bar smart tag to remove automatically generated “Item1” and “Item2” elements.

  8. Assign the Navigation Bar to the OfficeNavigationBar.NavigationClient property to bind both controls together. You will notice that the bar now has “Employees” and “Customers” elements based on existing Navigation Bar groups. Launch the app and click an element to see that the corresponding group is activated.

  9. Handle the NavBarControl.ActiveGroupChanged event to switch the selected Frame page. The code below uses page tags to find the required page.

    private void navBarControl1_ActiveGroupChanged(object sender, DevExpress.XtraNavBar.NavBarGroupEventArgs e) {navigationFrame1.SelectedPage = (NavigationPage)navigationFrame1.Pages.FindFirst(x => (string)x.Tag == e.Group.Caption);
    }

  10. Test your application at runtime. Note that, by default, animation effects are enabled.

  11. Return to design time, invoke the form smart tag (you may need to rebuild the project and reload the form to see it) and click “Convert to Ribbon Form”. This will convert your main form to a Ribbon Form, which will add Ribbon and Ribbon Status Bar controls.

  12. Add a BarSubItem with two child BarButtonItems to the Ribbon Page Group. End-users will be able to toggle between “Employees” and “Customers” Navigation Frame pages by clicking these buttons.

  13. At design time, double-click the first button to create a BarItem.ItemClick event handler. The code sample below illustrates how to switch active Navigation Bar groups. Coupled with the previously handled NavBarControl.ActiveGroupChanged event, this button also changes Navigation Frame pages.

    private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {navBarControl1.ActiveGroup = navBarControl1.Groups.First(x => x.Caption == e.Link.Caption);
    }

  14. Select the second BarButtonItem and locate the ItemClick event in the Visual Studio Properties window. Use the combo box to choose the same event handler as for the first button, so that both sub-menu items are functional. Launch the application and make sure the Navigation Frame changes its pages correctly.

如何:使用DevExpress模板库构建Office风格的UI

  1. In Visual Studio, go to “File | New | Project” or press CTRL+SHIFT+N to create a new project. Select the DevExpress Template Gallery option and click OK.

  2. In the DevExpress Template Gallery, select the “Blank Application” option and proceed to the next step.

  3. The selected template creates a project with an empty skinnable XtraForm and enables the Layout Assistant Extension. Open the form’s Smart Tag menu and click “Predefined Form Templates” under Layout Assistant Actions.

  4. Select the “Navigation Container” template (the “Office Inspired UI” group) and click Apply.

  5. Run the application and try the newly created UI. Try switching the themes using the In-Ribbon Gallery, navigate between the modules using the Ribbon menu or the bottom navigation control, and notice the animation effect when switching frames.

Visual Studio Inspired UI

一种Microsoft Visual studio风格的布局,在主工作区中包含一个选项卡或MDI界面,在表单的一侧包含面板,在顶部包含一个主菜单。

Windows Modern UI

一个平面,干净和轻量级的UI,灵感来自Windows商店应用程序。

Touch-Enabled Tile UI

支持触摸的应用程序,有时被称为混合应用程序,是易于在台式机和触摸设备上使用的应用程序。构建支持触摸的应用程序没有严格的模式,只是应用程序中的控件应该针对触摸输入进行优化。本节描述了一种常见的应用程序模式,并显示了一些最适合创建此类应用程序的DevExpress控件。

Fluent Design UI

http://www.lryc.cn/news/368730.html

相关文章:

  • 关于 Redis 中集群
  • C++必修:探索C++的内存管理
  • python列表---基本语法(浅拷贝,深拷贝等)
  • go语言接口之sort.Interface接口
  • android:text 总为大写字母的原因
  • CISCN2024 初赛 wp 部分复现(Re)
  • YOLOv10、YOLOv9 和 YOLOv8 在实际视频中的对比
  • 热题系列章节5
  • ArcGIS for js 4.x 加载图层
  • Three.js和Babylon.js,webGL中的对比效果分析!
  • flask实现抽奖程序(一)
  • Python中数据库连接的管理
  • 【JAVA技术】mybatis 数据库敏感字段加解密方案
  • Collections工具类及其案例
  • Duck Bro的第512天创作纪念日
  • 【机器学习】GPT-4中的机器学习如何塑造人类与AI的新对话
  • 晨控CK-UR12-E01与欧姆龙NX/NJ系列EtherNet/IP通讯手册
  • 模板显式、隐式实例化和(偏)特化、具体化的详细分析
  • 软件设计师笔记-计算机系统基础知识
  • flink 作业动态维护更新,不重启flink,不提交作业
  • 为何数据仓库需要“分层次”?
  • 小熊家务帮day15-day18 预约下单模块(预约下单,熔断降级,支付功能,退款功能)
  • [word] word悬挂缩进怎么设置? #经验分享#职场发展#经验分享
  • 6-Maven的使用
  • WPF真入门教程32--WPF数字大屏项目实干
  • 数据可视化Python实现超详解【数据分析】
  • Maxkb玩转大语言模型
  • React Hooks 封装可粘贴图片的输入框组件(wangeditor)
  • Wireshark TS | 应用传输丢包问题
  • 架构设计-web项目中跨域问题涉及到的后端和前端配置