Ejemplo n.º 1
0
        public static void OpenInputForm(XtraUserControl uc, Size size, bool isEdit)
        {
            frmOpen frm  = new frmOpen();
            string  temp = "";

            if (isEdit)
            {
                temp = (ConfigEngine.Language == "vi") ? "Cập Nhật" : "Update";
            }
            else
            {
                temp = (ConfigEngine.Language == "vi") ? "Thêm Mới" : "Add New";
            }
            frm.Text = string.Format("{0} {1}", temp, LanguageEngine.GetOpenFormText(uc.Name, ConfigEngine.Language));

            if (ConfigEngine.TouchMode)
            {
                int      width = 0, height = 0;
                string[] tmp = CaptionEngine.GetControlCaption(uc.Name, null, BaseConstant.FORM_SIZE, null).Split('|');
                width  = Convert.ToInt32(tmp[0]);
                height = Convert.ToInt32(tmp[1]);
                size   = new Size(width, height);
            }
            frm.Size        = size;
            frm.MaximumSize = size;
            frm.MinimumSize = size;

            frm.Controls.Clear();
            uc.Dock = DockStyle.Fill;
            frm.Controls.Add(uc);
            uc.Show();
            frm.ShowDialog();
        }
Ejemplo n.º 2
0
        //        private string TreeData = string.Format(@"
        //                            {
        //                                'rid' : 0, 'name' : '系统操作', 'childs' : [{
        //                                    'rid' : 'M0100', 'name' : '模块1', 'childs' : [{
        //                                        'rid' : 'M0101', 'name' : '模块1-1'
        //                                    },{
        //                                        'rid' : 'M0102', 'name' : '模块1-2'
        //                                    }]
        //                                },{
        //                                    'rid' : 'M0200', 'name' : '模块2', 'childs' : [{
        //                                        'rid' : 'M0201', 'name' : '模块2-1'
        //                                    }]
        //                                }]
        //                            }
        //        ");

        #region XtraTabPage控件
        /// <summary>
        /// 添加到Tab控件里
        /// </summary>
        /// <param name="Xuser">要添加到的TabControl</param>
        /// <param name="Xuser">要添加的用户控件实例</param>
        /// <param name="name"> 控件唯一的 name 属性</param>
        /// <param name="caption">显示标题 caption</param>
        public static void AddUserControl(XtraTabControl Xtab, Object obj, string name, string caption)
        {
            try
            {
                foreach (XtraTabPage Xpage in Xtab.TabPages)
                {
                    if (Xpage.Name == name)
                    {
                        Xtab.SelectedTabPage = Xpage;  // 存在则显示该页
                        return;
                    }
                }
                XtraTabPage page = new XtraTabPage();
                page.Name = name;            //控件标示
                page.Text = caption;         //显示标题
                XtraUserControl Xuser = new XtraUserControl();
                Xuser.Dock = DockStyle.Fill; //dock属性 全屏撑大
                XtraUserControl frm = (XtraUserControl)obj;
                //TicketSaleSystem.TicketOperate.TicketOperate frm = new TicketSaleSystem.TicketOperate.TicketOperate();
                frm.Show();
                page.Controls.Add(frm);
                Xtab.TabPages.Add(page);
                Xtab.SelectedTabPage = page;  // 切换显示到新增页
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 3
0
        public static void OpenInputForm(XtraUserControl uc, Size size)
        {
            frmOpen frm = new frmOpen();

            frm.Text        = LanguageEngine.GetOpenFormText(uc.Name, ConfigEngine.Language);
            frm.Size        = size;
            frm.MaximumSize = size;
            frm.MinimumSize = size;
            frm.Controls.Clear();
            uc.Dock = DockStyle.Fill;
            frm.Controls.Add(uc);
            uc.Show();
            frm.ShowDialog();
        }
Ejemplo n.º 4
0
        public static void OpenInputForm(XtraUserControl uc, string vnTitle, string enTitle, Size size)
        {
            string  languageID = new Configuration().Language;
            frmOpen frm        = new frmOpen();

            frm.Text        = (languageID.Equals("vi-VN")) ? vnTitle : enTitle;
            frm.Size        = size;
            frm.MaximumSize = size;
            frm.MinimumSize = size;
            frm.Controls.Clear();
            uc.Dock = DockStyle.Fill;
            frm.Controls.Add(uc);
            uc.Show();
            frm.ShowDialog();
        }
Ejemplo n.º 5
0
 public static void OpenInputForm(XtraUserControl uc, string vnTitle, string enTitle, Size size)
 {
     string languageID = new Configuration().Language;
     frmOpen frm = new frmOpen();
     frm.Text = (languageID.Equals("vi-VN")) ? vnTitle : enTitle;
     frm.Size = size;
     frm.MaximumSize = size;
     frm.MinimumSize = size;
     frm.Controls.Clear();
     uc.Dock = DockStyle.Fill;
     frm.Controls.Add(uc);
     uc.Show();
     frm.ShowDialog();
 }