Forex_Strategy_Builder.Strategy_Properties.OnResize C# (CSharp) Метод

OnResize() защищенный Метод

protected OnResize ( EventArgs e ) : void
e System.EventArgs
Результат void
        protected override void OnResize(EventArgs e)
        {
            base.OnResize(e);

            int buttonHeight = (int)(Data.VerticalDLU * 15.5);
            int btnVertSpace = (int)(Data.VerticalDLU * 5.5);
            int btnHrzSpace  = (int)(Data.HorizontalDLU * 3);
            int buttonWidth  = (int)((rightPanelsWidth - 2 * btnHrzSpace) / 3);
            int space        = btnHrzSpace;
            int textHeight   = Font.Height;
            int border       = 2;
            int leftComboBxWith = 80;
            int rightComboBxWith = 95;
            int nudWidth     = 60;
            int lblPercentWidth = 15;

            // pnlAveraging
            pnlAveraging.Size = new Size(leftPanelsWidth, 84);
            pnlAveraging.Location = new Point(space, space);

            // pnlAmounts
            pnlAmounts.Size = new Size(leftPanelsWidth, 222);
            pnlAmounts.Location = new Point(space, pnlAveraging.Bottom + space);

            // pnlProtection
            pnlProtection.Size = new Size(rightPanelsWidth, 84);
            pnlProtection.Location = new Point(pnlAveraging.Right + space, pnlAveraging.Top);

            // Averaging
            int comboBxLeft = pnlAveraging.ClientSize.Width - leftComboBxWith - space - border;

            cbxSameDirAction.Width = leftComboBxWith;
            lblSameDirAction.Location = new Point(space, space + 25);
            cbxSameDirAction.Location = new Point(comboBxLeft, space + 21);

            cbxOppDirAction.Width = leftComboBxWith;
            lblOppDirAction.Location = new Point(space, buttonHeight + 2 * space + 23);
            cbxOppDirAction.Location = new Point(comboBxLeft, buttonHeight + 2 * space + 19);

            // Amounts
            int nudLeft = leftPanelsWidth - nudWidth - space - border;

            lblMaxOpenLots.Location = new Point(space, 0 * buttonHeight + space + 25);
            nudMaxOpenLots.Size = new Size(nudWidth, buttonHeight);
            nudMaxOpenLots.Location = new Point(nudLeft, 0 * buttonHeight + space + 22);

            rbConstantUnits.Location = new Point(space + 3, 55);
            rbVariableUnits.Location = new Point(space + 3, 79);
            rbVariableUnits.Size = new Size(leftPanelsWidth - 2 * space, 2 * buttonHeight);

            lblEntryLots.Location = new Point(btnHrzSpace, 139);
            nudEntryLots.Size = new Size(nudWidth, buttonHeight);
            nudEntryLots.Location = new Point(nudLeft, 137);
            lblPercent1.Width = lblPercentWidth;
            lblPercent1.Location = new Point(nudEntryLots.Left - lblPercentWidth, lblEntryLots.Top);

            lblAddingLots.Location = new Point(btnHrzSpace, 167);
            nudAddingLots.Size = new Size(nudWidth, buttonHeight);
            nudAddingLots.Location = new Point(nudLeft, 165);
            lblPercent2.Width = lblPercentWidth;
            lblPercent2.Location = new Point(nudAddingLots.Left - lblPercentWidth, lblAddingLots.Top);

            lblReducingLots.Location = new Point(btnHrzSpace, 195);
            nudReducingLots.Size = new Size(nudWidth, buttonHeight);
            nudReducingLots.Location = new Point(nudLeft, 193);
            lblPercent3.Width = lblPercentWidth;
            lblPercent3.Location = new Point(nudReducingLots.Left - lblPercentWidth, lblReducingLots.Top);

            nudLeft = rightPanelsWidth - nudWidth - btnHrzSpace - border;
            comboBxLeft = nudLeft - space - rightComboBxWith;

            // Permanent Stop Loss
            chbPermaSL.Location = new Point(border + space, 0 * buttonHeight + 1 * space + 24);
            cbxPermaSLType.Width = rightComboBxWith;
            cbxPermaSLType.Location = new Point(comboBxLeft, 0 * buttonHeight + 1 * space + 21);
            nudPermaSL.Size = new Size(nudWidth, buttonHeight);
            nudPermaSL.Location = new Point(nudLeft, 0 * buttonHeight + 1 * space + 22);

            // Permanent Take Profit
            chbPermaTP.Location = new Point(border + space, 1 * buttonHeight + 2 * space + 22);
            nudPermaTP.Size = new Size(nudWidth, buttonHeight);
            cbxPermaTPType.Width = rightComboBxWith;
            cbxPermaTPType.Location = new Point(comboBxLeft, 1 * buttonHeight + 2 * space + 19);
            nudPermaTP.Location = new Point(nudLeft, 1 * buttonHeight + 2 * space + 20);

            pnlSmallBalanceChart.Size = new Size(rightPanelsWidth, pnlAmounts.Height);
            pnlSmallBalanceChart.Location = new Point(pnlAveraging.Right + space, pnlProtection.Bottom + space);

            // Button Accept
            btnAccept.Size  = new Size(buttonWidth, buttonHeight);
            btnDefault.Size = new Size(buttonWidth, buttonHeight);
            btnCancel.Size  = new Size(buttonWidth, buttonHeight);
            int buttonTop = ClientSize.Height - buttonHeight - btnVertSpace;

            btnAccept.Location  = new Point(pnlProtection.Left, buttonTop);
            btnDefault.Location = new Point((pnlProtection.Left + pnlProtection.Right - buttonWidth) / 2, buttonTop);
            btnCancel.Location  = new Point(pnlProtection.Right - buttonWidth, buttonTop);

            return;
        }