public override void move(Point pos) { // Move this element base.move(pos); // Find the distance between both elements int distance = buttonBuildBuilding.Bounds.Left - labelBuildingNameAndCost.Bounds.Left; // Move the child elements labelBuildingNameAndCost.move(new Point(Bounds.Location.X, Bounds.Location.Y + 2)); // Move the label down a little; it looks better buttonBuildBuilding.move(new Point(Bounds.Left + distance, Bounds.Top)); }
public override void move(Point pos) { // Move this element base.move(pos); // Find the distance between both elements int distanceToRemove = buttonRemoveSelection.Bounds.Left - labelUnitSelection.Bounds.Left; int distanceToAdd = buttonAddSelection.Bounds.Left - labelUnitSelection.Bounds.Left; // Move the child elements labelUnitSelection.move(new Point(Bounds.Location.X, Bounds.Location.Y + 2)); // Move the label down a little; it looks better buttonRemoveSelection.move(new Point(Bounds.Left + distanceToRemove, Bounds.Top)); buttonAddSelection.move(new Point(Bounds.Left + distanceToAdd, Bounds.Top)); }