Exemplo n.º 1
0
 public PanelCustom(UserControlCustom userControl)
 {
     _userControl = userControl;
     InitializeComponent();
     LoadUserControl();
     Init();
 }
Exemplo n.º 2
0
        protected void LaunchSheet(UserControlCustom control, bool fullSize = false, int offset = 150)
        {
            if (_sheet != null)
            {
                _sheet.Controls.Clear();
                if (control != null)
                {
                    control.Top = offset;
                    if (fullSize)
                    {
                        control.Top           -= 20;
                        control.Left           = 4;
                        control.Height         = _sheet.Height - offset + 16;
                        control.Width          = _sheet.Width - 8;
                        control.Anchor         = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right) | System.Windows.Forms.AnchorStyles.Bottom)));
                        control.Name           = "CurrentViewFull";
                        _sheet.BackColor       = System.Drawing.Color.Black;
                        _sheet.BackgroundImage = null;
                    }
                    else
                    {
                        control.Left                 = (_sheet.Width / 2) - (control.Width / 2);
                        control.Name                 = "CurrentView";
                        _sheet.BackColor             = System.Drawing.Color.Black;
                        _sheet.BackgroundImage       = Properties.Resources.ShieldTileBg;
                        _sheet.BackgroundImageLayout = ImageLayout.Tile;
                    }
                    control.ChangeLanguage();
                    control.RefreshData();
                    control.Refresh();

                    _sheet.Controls.Add(control);
                }
                SheetDisplayRequested?.Invoke(null);
            }
        }