• DevExpress窗体皮肤


      相信很多朋友希望自己的软件可以非常漂亮,本文就简要介绍一下,对窗体换肤。

    1、在程序入口处,即Program.cs添加如下代码:

           DevExpress.UserSkins.OfficeSkins.Register();
           DevExpress.UserSkins.BonusSkins.Register();

    2、所应用样式窗体需要继承自DevExpress.XtraEditors.XtraForm;

    3、添加defaultLookAndFeel1控件;

    4、在应用窗体调用如下代码:

     #region 初始化皮肤
            private void InitSkin()
            {
                BarSubItem bar = new BarSubItem();
                bar.Caption = "皮肤设置";
                bar.Name = "皮肤设置";

                //迭代出所有皮肤样式

                foreach (DevExpress.Skins.SkinContainer skin in DevExpress.Skins.SkinManager.Default.Skins)
                {

                    BarButtonItem barBI = new BarButtonItem();
                    barBI.Tag = skin.SkinName;
                    barBI.Name = skin.SkinName;
                    barBI.Caption = skin.SkinName;
                    barBI.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(ItemClick);


                    this.barManager1.Items.AddRange(new DevExpress.XtraBars.BarItem[] { barBI });
                    bar.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(barBI) });


                }
                this.barManager1.Items.AddRange(new DevExpress.XtraBars.BarItem[] { bar });

                this.barMenu.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] { new DevExpress.XtraBars.LinkPersistInfo(bar) });

            }

            #region 皮肤单击事件
            private void ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
            {

                defaultLookAndFeel1.LookAndFeel.SetSkinStyle(e.Item.Tag.ToString());
                e.Item.Hint = e.Item.Tag.ToString();
            }
            #endregion

  • 相关阅读:
    promethues 中文文档书 https://yunlzheng.gitbook.io/prometheus-book/parti-prometheus-ji-chu/quickstart
    jenkins获取BUILD_NUMBER $BUILD_NUMBER http://localhost:8080/env-vars.html.
    visual studio 各个版本
    让TouchBar固定显示 F1 – F12 键
    CentOS 8 启动盘的安装
    ipset 笔记
    html javascript 设置cookie永不过期
    在线cookie转json, 在线chrome请求 转python代码, 在线chrome请求转php代码
    js加密字符串
    cookie利用代码
  • 原文地址:https://www.cnblogs.com/Foric/p/2034073.html
Copyright © 2020-2023  润新知