• 关闭tab时,定位到导航栏对应的激活tab


            /// <summary>
            /// 关闭tab时,定位到导航栏对应的激活tab
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            private void DXtrtable_SelectedPageChanged(object sender, TabPageChangedEventArgs e)
            {               
                if (e.Page.Tag == null)
                {
                    return;
                }
                string functionCode = e.Page.Tag.ToString(); //Tab,每个Tab的代码
                this.SelectItem(functionCode);
            }
    /// <summary>
            /// DevExpress.XtraNavBar.NavBarControl 导航控件定位或选中状态
            /// 另导航的选项为选中状态
            /// </summary>
            /// <param name="functionCode">Tag的代码,需要定位的导航项</param>
            private void SelectItem(string functionCode)
            {
                Console.WriteLine(String.Concat("SelectItem", functionCode));
                var length = this.DnBarControl.Groups.Count;
                for (int groupIndex = 0; groupIndex < length; groupIndex++)
                {
                    var itemLength = this.DnBarControl.Groups[groupIndex].ItemLinks.Count;
    
                    for (int itemIndex = 0; itemIndex < itemLength; itemIndex++)
                    {
                        var result = this.DnBarControl.Groups[groupIndex].ItemLinks[itemIndex].Item.Tag.ToString();
    
                        if (result == functionCode)
                        {
                            this.DnBarControl.Groups[groupIndex].Expanded = true;
                            this.DnBarControl.Groups[groupIndex].SelectedLinkIndex = itemIndex;
    
                            return;
    
                        }
                    }
                }
            }
  • 相关阅读:
    求一个数的阶乘在 m 进制下末尾 0 的个数
    区间dp
    最长公共子序列变形
    学习stm32专区
    C/C++中static关键字详解
    ASP.NET调用Office Com组件权限设置
    TreeView控件
    SQL笔记(1)索引/触发器
    NPOI 1.2.5 教程
    SQL Povit
  • 原文地址:https://www.cnblogs.com/panxihua/p/6869369.html
Copyright © 2020-2023  润新知