zoukankan      html  css  js  c++  java
  • XAF 如何在工具栏显示多参数

    1.在ViewController上添加两个ParameterAction

    2.隐藏一个ParameterAction中的Action

    3.实现代码:

     private void ParermaterViewController_ViewControlsCreated(object sender, EventArgs e)
            {
                IBarManagerHolder bmh 
    = Frame.Template as IBarManagerHolder;
                
    if (bmh != null && bmh.BarManager != null)
                {

                    
    foreach (BarItem item in bmh.BarManager.Items)
                    {
                        BarEditItem eitem 
    = item as BarEditItem;
                        
    if (eitem != null && eitem.Tag == FromParaAction)
                        {
                            ((DevExpress.XtraEditors.Repository.RepositoryItemDateEdit)eitem.Edit).Buttons[
    1].Visible = false;
                            ((DevExpress.XtraEditors.Repository.RepositoryItemDateEdit)eitem.Edit).EditMask 
    = "dd/MM/yyyy";
                            eitem.Width 
    = 120;
                            eitem.AutoFillWidth 
    = false;
                            eitem.Caption 
    = FromParaAction.Caption;
                           
                            
    //eitem.Edit.EditValueChanged += new EventHandler(FromAction_EditValueChanged);
                        }
                        
    else if (eitem != null && eitem.Tag == ToParaAction)
                        {
                            ((DevExpress.XtraEditors.Repository.RepositoryItemDateEdit)eitem.Edit).Buttons[
    1].Visible = true;
                            ((DevExpress.XtraEditors.Repository.RepositoryItemDateEdit)eitem.Edit).EditMask 
    = "dd/MM/yyyy";
                            eitem.Width 
    = 140;
                            eitem.AutoFillWidth 
    = false;
                            eitem.Caption 
    = ToParaAction.Caption;
                            
    //eitem.EditValue = DateTime.Now;
                            
    //eitem.Edit.EditValueChanged += new EventHandler(ToAction_EditValueChanged);
                        }

                       
    // BarButtonItem bitem = item as BarButtonItem;
                        
    //if (bitem != null && (bitem.Tag == ApplyFilterAction || bitem.Tag == RemoveFilterAction))
                        
    //{
                        
    //    bitem.Width = 120;
                        
    //}

                        
    //foreach (BarItemLink itemLink in item.Links)
                        
    //{
                        
    //    //if (itemLink != null && (itemLink.Caption == ApplyFilterAction.Caption || itemLink.Caption == RemoveFilterAction.Caption) )
                        
    //    if (itemLink != null && (itemLink.Caption == ToAction.Caption || itemLink.Caption == RemoveFilterAction.Caption))
                        
    //    {
                        
    //        itemLink.BeginGroup = true;
                        
    //    }
                        
    //}

                    }
                }
            }
  • 相关阅读:
    bootstrap学习笔记一: bootstrap初认识,hello bootstrap(下)
    bootstrap学习笔记一: bootstrap初认识,hello bootstrap(上)
    AutoCompleteTextView的使用
    常用的android弹出对话框
    PopupWindow的使用
    linux udev、mdev 介绍
    linux 守护进程编程
    linux 下的文件目录操作之遍历目录
    linux 下查找图片文件方法
    linux 内核 zImage 生成过程分析
  • 原文地址:https://www.cnblogs.com/Tonyyang/p/1979665.html
Copyright © 2011-2022 走看看