private void OpenForm(string strMenuName, string strFormName)
        {
            RadForm _RadForm = new RadForm();

            _RadForm = TryGetFormByName(strFormName);
            HostWindow _HostWindowForm = null;

            if (ClsUtility._IClsUtility.IsFormOpen(_RadForm.GetType(), RdDockMain, out _HostWindowForm))
            {
                _HostWindowForm.ActivateAsMdiChild();
                _RadForm.Activate();
                RdDockMain.ActivateWindow(_HostWindowForm);
                RdDockMain.ActivateMdiChild(_RadForm);
            }
            else
            {
                //var icon = IconChar.FileExcel;
                Color randomColor = Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256));
                cFormIcon = _RadForm.Tag != null && _RadForm.Tag.ToString().Trim() != "" ? _RadForm.Tag.ToString().Trim() : "Circle";
                var iconImage = ((IconChar)Enum.Parse(typeof(IconChar), cFormIcon)).ToBitmap(16, randomColor);
                _RadForm.MdiParent = this;
                _RadForm.Show();
                _RadForm.Activate();
                //_RadForm.Icon = iconImage;
                RdDockMain.ActivateMdiChild(_RadForm);
                foreach (DockWindow dw in RdDockMain.DockWindows)
                {
                    dw.AllowedDockState = ~AllowedDockState.Floating;
                }
            }
        }
Пример #2
0
        private void OpenForm(string strMenuName, string strFormName)
        {
            RadForm _RadForm = new RadForm();

            _RadForm = TryGetFormByName(strFormName);
            HostWindow _HostWindowForm = null;

            if (ClsUtility._IClsUtility.IsFormOpen(_RadForm.GetType(), RdDockMain, out _HostWindowForm))
            {
                _HostWindowForm.ActivateAsMdiChild();
                _RadForm.Activate();
                RdDockMain.ActivateWindow(_HostWindowForm);
                RdDockMain.ActivateMdiChild(_RadForm);
            }
            else
            {
                //obj = new Form();
                // _RadForm = TryGetFormByName(strFormName);
                _RadForm.MdiParent = this;
                _RadForm.Show();
                _RadForm.Activate();
                RdDockMain.ActivateMdiChild(_RadForm);
            }
        }