private void CalculatePlacementsVertical()
{
this.ResetItemPlacements();
System.Windows.Forms.ToolStrip toolStrip = this.ToolStrip;
int num = 0;
if (this.ToolStrip.CanOverflow)
{
this.ForwardsWalkingIndex = 0;
while (this.ForwardsWalkingIndex < this.ToolStrip.Items.Count)
{
ToolStripItem item = toolStrip.Items[this.ForwardsWalkingIndex];
if (((IArrangedElement)item).ParticipatesInLayout)
{
if (item.Overflow == ToolStripItemOverflow.Always)
{
this.OverflowRequired = true;
}
if ((item.Overflow != ToolStripItemOverflow.Always) && (item.Placement == ToolStripItemPlacement.None))
{
Size size = item.AutoSize ? item.GetPreferredSize(this.displayRectangle.Size) : item.Size;
int num2 = this.OverflowRequired ? this.OverflowButtonSize.Height : 0;
num += size.Height + item.Margin.Vertical;
if (num > (this.displayRectangle.Height - num2))
{
int num3 = this.SendNextItemToOverflow(num - this.displayRectangle.Height, false);
num -= num3;
}
}
}
this.ForwardsWalkingIndex++;
}
}
this.PlaceItems();
}