Exemplo n.º 1
0
        /// <summary>
        /// Use _panelOptions size / location to build the real options control
        /// </summary>
        private ControlT BuildOptionControl <ControlT>() where ControlT : Control, new()
        {
            ControlT ctrl = new ControlT();

            ctrl.Dock     = DockStyle.Fill;
            ctrl.TabIndex = 0;
            ctrl.Margin   = new Padding(0, 0, 0, 0);
            ctrl.Padding  = new Padding(0, 0, 0, 0);

            _panelOptions.Controls.Add(ctrl);
            return(ctrl);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Use _panelOptions size / location to build the real options control
        /// </summary>
        private ControlT BuildOptionControl <ControlT>() where ControlT : Control, new()
        {
            ControlT ctrl = new ControlT();

            ctrl.Location = _panelOptions.Location;
            ctrl.Size     = new Size(_panelOptions.Size.Width, _panelOptions.Size.Height);
            ctrl.Anchor   = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
            ctrl.TabIndex = 0;
            ctrl.Padding  = new Padding(0, 0, 0, 0);

            this.Controls.Add(ctrl);

            return(ctrl);
        }