void SetFormSize()
{
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 space = btnHrzSpace;
int textHeight = Font.Height;
int leftComboBxWith = 80;
int rightComboBxWith = 95;
int nudWidth = 60;
int lblPercentWidth = 15;
int border = 2;
leftPanelsWidth = 3 * buttonWidth + 2 * btnHrzSpace;
rightPanelsWidth = 3 * buttonWidth + 2 * btnHrzSpace;
if (leftPanelsWidth < space + lblSameDirAction.Width + space + leftComboBxWith + space)
leftPanelsWidth = space + lblSameDirAction.Width + space + leftComboBxWith + space;
if (leftPanelsWidth < space + lblOppDirAction.Width + space + leftComboBxWith + space)
leftPanelsWidth = space + lblOppDirAction.Width + space + leftComboBxWith + space;
if (leftPanelsWidth < space + lblMaxOpenLots.Width + space + nudWidth + space)
leftPanelsWidth = space + lblMaxOpenLots.Width + space + nudWidth + space;
rbVariableUnits.Width = leftPanelsWidth - 2 * space;
Graphics g = CreateGraphics();
while (g.MeasureString(rbVariableUnits.Text, rbVariableUnits.Font, rbVariableUnits.Width - 10).Height > 3 * rbVariableUnits.Font.Height)
rbVariableUnits.Width++;
g.Dispose();
if (leftPanelsWidth < space + rbVariableUnits.Width + space)
leftPanelsWidth = space + rbVariableUnits.Width + space;
if (leftPanelsWidth < space + lblEntryLots.Width + space + lblPercentWidth + nudWidth + space)
leftPanelsWidth = space + lblEntryLots.Width + space + lblPercentWidth + nudWidth + space;
if (leftPanelsWidth < space + lblAddingLots.Width + space + lblPercentWidth + nudWidth + space)
leftPanelsWidth = space + lblAddingLots.Width + space + lblPercentWidth + nudWidth + space;
if (leftPanelsWidth < space + lblReducingLots.Width + space + lblPercentWidth + nudWidth + space)
leftPanelsWidth = space + lblReducingLots.Width + space + lblPercentWidth + nudWidth + space;
int maxRightCheckBoxWidth = Math.Max(chbPermaSL.Width, chbPermaTP.Width);
int requiredRightPanelWidth = border + space + maxRightCheckBoxWidth + space + rightComboBxWith + space + nudWidth + space + border;
if (rightPanelsWidth < requiredRightPanelWidth)
rightPanelsWidth = requiredRightPanelWidth;
ClientSize = new Size(space + leftPanelsWidth + space + rightPanelsWidth + space, 360);
}