Forex_Strategy_Builder.Pivot_Points_Calculator.OnResize C# (CSharp) Method

OnResize() protected method

Recalculates the sizes and positions of the controls after resizing.
protected OnResize ( EventArgs e ) : void
e System.EventArgs
return void
        protected override void OnResize(EventArgs e)
        {
            base.OnResize(e);

            int buttonHeight = (int)(Data.VerticalDLU * 15.5);
            int buttonWidth = (int)(Data.HorizontalDLU * 60);
            int btnVertSpace = (int)(Data.VerticalDLU * 5.5);
            int btnHrzSpace = (int)(Data.HorizontalDLU * 3);
            int border = btnHrzSpace;
            int textHeight = Font.Height;
            int width = 100; // Right side controls

            // pnlInput
            pnlInput.Size = new Size(ClientSize.Width - 2 * border, 112);
            pnlInput.Location = new Point(border, border);

            int left = pnlInput.ClientSize.Width - width - btnHrzSpace - 1;

            int shift     = 26;
            int vertSpace = 2;
            int numb      = 0;
            foreach (Label lbl in alblInputNames)
            {
                lbl.Location = new Point(border, numb * buttonHeight + (numb + 1) * vertSpace + shift);
                numb++;
            }

            shift     = 24;
            vertSpace = 2;
            numb      = 0;
            foreach (TextBox lbl in atbxInputValues)
            {
                lbl.Width = width;
                lbl.Location = new Point(left, numb * buttonHeight + (numb + 1) * vertSpace + shift);
                numb++;
            }

            // pnlOutput
            pnlOutput.Size = new Size(ClientSize.Width - 2 * border, 180);
            pnlOutput.Location = new Point(border, pnlInput.Bottom + border);

            shift     = 24;
            vertSpace = -4;
            numb      = 0;
            foreach (Label lbl in alblOutputNames)
            {
                lbl.Location = new Point(border, numb * (buttonHeight + vertSpace) + shift);
                numb++;
            }

            numb = 0;
            foreach (Label lbl in alblOutputValues)
            {
                lbl.Location = new Point(left, numb * (buttonHeight + vertSpace) + shift);
                numb++;
            }

            return;
        }