Пример #1
0
        private void ultraTabbedMdiManager1_InitializeTab(object sender, Infragistics.Win.UltraWinTabbedMdi.MdiTabEventArgs e)
        {
            string frmName;

            try
            {
                //frmName = e.Tab.Form.Name;
                //20170117 frmGridEditBase繼承的表單都有問題帶不出來 改為帶Text
                frmName = e.Tab.Form.Text;
                frmName = frmName.Replace("Frm", "");
                if (frmName.ToUpper() == "PROGRAMLIST")
                {
                    e.Tab.Settings.CloseButtonVisibility = Infragistics.Win.UltraWinTabs.TabCloseButtonVisibility.Never;
                    frmName = "主選單";
                }

                e.Tab.Text = frmName;   //修改駐列tab 的名稱

                //e.Tab.Form.Tag = e.Tab;
                //e.Tab.ToolTip = e.Tab.Form.Text;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void ultraTabbedMdiManager1_InitializeTab(object sender, Infragistics.Win.UltraWinTabbedMdi.MdiTabEventArgs e)
        {
            // initialize the mdi tabs key as appropriate.
            frmContent frmContent = e.Tab.Form as frmContent;

            if (frmContent == null)
            {
                if (e.Tab.Form is frmContentEmpty)
                {
                    e.Tab.Key = CONTENTEMPTY;
                }
                return;
            }

            switch (frmContent.ContentType)
            {
            case OutlookCRM.Enums.ContentType.Customers:
                e.Tab.Key = CUSTOMERS;
                this.ultraStatusBar1.SetStatusBarText(frmContent.Grid, Utilities.GetLocalizedString("Customers"));
                break;

            case OutlookCRM.Enums.ContentType.Orders:
                e.Tab.Key = ORDERS;
                this.ultraStatusBar1.SetStatusBarText(frmContent.Grid, Utilities.GetLocalizedString("Orders"));
                break;

            case OutlookCRM.Enums.ContentType.OrderDetails:
                e.Tab.Key = ORDERDETAILS;
                this.ultraStatusBar1.SetStatusBarText(frmContent.Grid, Properties.Resources.OrderDetails);
                break;

            case OutlookCRM.Enums.ContentType.ProductSales:
                e.Tab.Key = PRODUCTS;
                this.ultraStatusBar1.SetStatusBarText(frmContent.Grid, Utilities.GetLocalizedString("Products"));
                break;

            case OutlookCRM.Enums.ContentType.SalesByCategory:
                e.Tab.Key = CATEGORIES;
                this.ultraStatusBar1.SetStatusBarText(frmContent.Grid, Utilities.GetLocalizedString("Categories"));
                break;

            case OutlookCRM.Enums.ContentType.Shippers:
                e.Tab.Key = SHIPPERS;
                this.ultraStatusBar1.SetStatusBarText(frmContent.Grid, Utilities.GetLocalizedString("Shippers"));
                break;

            default:
                break;
            }

            // set the AutoStatus text for the status bar when over the parts of the content form.
            this.ultraStatusBar1.SetStatusBarText(frmContent.Grid, frmContent.GetStatusBarTextGrid());
            this.ultraStatusBar1.SetStatusBarText(frmContent.Chart1, frmContent.GetStatusBarTextChart1());
            this.ultraStatusBar1.SetStatusBarText(frmContent.Chart2, frmContent.GetStatusBarTextChart2());
            this.ultraStatusBar1.SetStatusBarText(frmContent.Chart3, frmContent.GetStatusBarTextChart3());
        }
Пример #3
0
 private void ultraTabbedMdiManager1_TabActivated(object sender, Infragistics.Win.UltraWinTabbedMdi.MdiTabEventArgs e)
 {
     try
     {
         this.Text = (e.Tab.Form as YR.ERP.Base.Forms.FrmBase).Title;
     }
     catch (Exception ex)
     {
         WfShowErrorMsg(ex.ToString());
     }
 }