27 writes to Top
System.Windows.Forms (24)
System\Windows\Forms\Control.cs (2)
9822padding.Top = (int)Math.Round(padding.Top * dy); 9824margins.Top = (int)Math.Round(margins.Top * dy);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (1)
277value.Top = Math.Max(0, value.Top);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (1)
144padding.Top = 0;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (17)
121cellMargin.Top -= spaceToFree; 128cellMargin.Top = 0; 198cellMargin.Top -= requiredSpace; 205cellMargin.Top = 0; 219cellMargin.Top += spaceToFree; 267cellMargin.Top -= requiredSpace; 274cellMargin.Top = 0; 302cellMargin.Top += spaceToFree; 332cellMargin.Top += freedSpace; 370cellMargin.Top -= spaceToFree; 378cellMargin.Top = 0; 472nextCellMargin.Top -= requiredSpace; 490nextCellMargin.Top -= freedSpace; 506lastCellMargin.Top = Math.Max(0, locationToDrag.Y - nextCell.Bounds.Bottom); 527newCellMargin.Top = freedSpace - controlToDragWidth; 547cellMargin.Top = Math.Max(0, locationToDrag.Y - Row.Margin.Top); 580nextCellMargin.Top += spaceOccupiedByCell;
System\Windows\Forms\Layout\LayoutUtils.cs (2)
146padding.Top = Math.Max(0, padding.Top); 423padding.Top = padding.Left;
System\Windows\Forms\Scrolling\ScrollableControl.DockPaddingEdgesConverter.cs (1)
179padding.Top = value;
System.Windows.Forms.Primitives (1)
System\Windows\Forms\Padding.cs (1)
179private void ResetTop() => Top = 0;
System.Windows.Forms.Tests (2)
System\Windows\Forms\PaddingTests.cs (2)
203Top = value 238Top = value
145 references to Top
PresentationUI (11)
MS\Internal\Documents\SignatureSummaryDialog.cs (11)
578return h + CellPadding.Top + CellPadding.Bottom; 662bounds.Y + CellPadding.Top, 664bounds.Height - CellPadding.Top - CellPadding.Bottom 672bounds.Y + CellPadding.Top, 674bounds.Height - CellPadding.Top - CellPadding.Bottom 680bounds.Y + CellPadding.Top, 682bounds.Height - CellPadding.Top - CellPadding.Bottom 707bounds.Y + CellPadding.Top, 709bounds.Height - CellPadding.Top - CellPadding.Bottom 715bounds.Y + CellPadding.Top, 717bounds.Height - CellPadding.Top - CellPadding.Bottom
System.Windows.Forms (67)
System\Windows\Forms\Control.cs (2)
9822padding.Top = (int)Math.Round(padding.Top * dy); 9824margins.Top = (int)Math.Round(margins.Top * dy);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (2)
700valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.Top); 704valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.Top);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (2)
3617rectPadding.Height = cellStyle.Padding.Top; 3805borderAndPaddingWidths.Y += cellStyle.Padding.Top;
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (3)
266if (value.Left < 0 || value.Right < 0 || value.Top < 0 || value.Bottom < 0) 277value.Top = Math.Max(0, value.Top); 292Debug.Assert(value.Top >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (2)
1123valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.Top); 1127valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.Top);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (4)
781valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.Top); 785valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.Top); 881valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.Top); 885valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.Top);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (3)
533borderAndPaddingWidths.Y += cellStyle.Padding.Top; 1945valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.Top); 1949valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.Top);
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
770cellStyle.Padding.Top);
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (2)
927valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.Top); 931valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.Top);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (4)
662valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.Top); 666valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.Top); 746valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.Top); 750valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.Top);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (2)
695valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.Top); 699valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.Top);
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (2)
285valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.Top); 289valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.Top);
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (1)
165_fontHeight + padding.Top,
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (1)
4254gripRectangle.Y = Math.Max(0, displayRect.Top - Grip.Margin.Top);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.ToolStripDropDownButtonInternalLayout.cs (1)
82_dropDownArrowRect = new Rectangle(0, options.Client.Bottom + _dropDownArrowPadding.Top, _ownerItem.Bounds.Width - 1, s_dropDownArrowSize.Height);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (7)
99rect = LayoutUtils.InflateRect(rect, new Padding(0, Padding.Top, 0, Padding.Bottom)); 363nextPoint = new Point(_checkPadding.Left, _checkPadding.Top); 368nextPoint.Y = _imagePadding.Top; 378nextPoint = new Point(1, _checkPadding.Top); 398nextPoint = new Point(1, _checkPadding.Top); 420nextPoint.Y = _textPadding.Top; 425nextPoint.Y = _arrowPadding.Top;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (2)
530margins[i] = c.Margin.Top; 540cachedBounds.X = Math.Max(0, cachedBounds.X - margins[i] - c.Margin.Top);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (1)
67dragBounds.Height += (nextRowBounds.Height >> 2) + Row.Margin.Bottom + ToolStripPanel.RowsInternal[index + 1].Margin.Top;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (8)
72dragBounds.Y -= Row.Margin.Top + ToolStripPanel.Padding.Top + 4; 119if (cellMargin.Top >= spaceToFree) 127spaceToFree -= lastCellOnRow.Margin.Top; 368if (cellMargin.Top >= spaceToFree) 377spaceToFree -= lastCellOnRow.Margin.Top; 470if (nextCellMargin.Top > requiredSpace) 547cellMargin.Top = Math.Max(0, locationToDrag.Y - Row.Margin.Top);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (2)
149insertionRect = new Rectangle(item.Bounds.Right, _owner.Margin.Top, ToolStrip.s_insertionBeamWidth, _owner.Height - (_owner.Margin.Vertical) - 1); 152insertionRect = new Rectangle(item.Bounds.Left, _owner.Margin.Top, ToolStrip.s_insertionBeamWidth, _owner.Height - (_owner.Margin.Vertical) - 1);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackLayout.cs (4)
299y += itemMargin.Top; 312y += itemMargin.Top; 437lastBottom = y - itemMargin.Top; 444y = lastTop + itemMargin.Top;
System\Windows\Forms\Layout\ArrangedElement.cs (2)
74Debug.Assert((value.Right >= 0 && value.Left >= 0 && value.Top >= 0 && value.Bottom >= 0), "who's setting margin negative?"); 86Debug.Assert((value.Right >= 0 && value.Left >= 0 && value.Top >= 0 && value.Bottom >= 0), "who's setting padding negative?");
System\Windows\Forms\Layout\DefaultLayout.cs (1)
678preferredSizeForAnchoring.Height -= containerPadding.Top;
System\Windows\Forms\Layout\FlowLayout.cs (2)
321Debug.Assert(container.Children[0].Bounds.Y == margin.Top + container.DisplayRectangle.Y); 326Debug.Assert(container.Children[0].Bounds.Y == margin.Top + container.DisplayRectangle.Y);
System\Windows\Forms\Layout\LayoutUtils.cs (4)
146padding.Top = Math.Max(0, padding.Top); 375rect.Y -= padding.Top; 384rect.Y += padding.Top; 422temp = padding.Top;
System\Windows\Forms\Scrolling\ScrollableControl.DockPaddingEdgesConverter.cs (2)
67|| _owner.Padding.Top != -1 169get => _owner is null ? _top : _owner.Padding.Top;
System.Windows.Forms.Design (4)
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (1)
175lines.Add(new SnapLine(SnapLineType.Horizontal, loc.Y - _primaryControl.Margin.Top, SnapLine.MarginTop, SnapLinePriority.Always));
System\Windows\Forms\Design\ControlDesigner.cs (1)
360snapLines.Add(new SnapLine(SnapLineType.Horizontal, -margin.Top, SnapLine.MarginTop, SnapLinePriority.Always));
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (2)
154bounds.Top - margin.Top, 220bounds.Y -= margin.Top;
System.Windows.Forms.Primitives (18)
System\Windows\Forms\Internals\ScaleHelper.cs (1)
287ScaleToDpi(logicalPadding.Top, dpi),
System\Windows\Forms\Padding.cs (13)
125public readonly int Vertical => Top + Bottom; 140&& Top == other.Top 148new(p1.Left + p2.Left, p1.Top + p2.Top, p1.Right + p2.Right, p1.Bottom + p2.Bottom); 154new(p1.Left - p2.Left, p1.Top - p2.Top, p1.Right - p2.Right, p1.Bottom - p2.Bottom); 160p1.Left == p2.Left && p1.Top == p2.Top && p1.Right == p2.Right && p1.Bottom == p2.Bottom; 167public override readonly int GetHashCode() => HashCode.Combine(Left, Top, Right, Bottom); 169public override readonly string ToString() => $"{{Left={Left},Top={Top},Right={Right},Bottom={Bottom}}}"; 197Debug.Assert(All == Left && Left == Top && Top == Right && Right == Bottom, "_all is true, but All/Left/Top/Right/Bottom inconsistent.");
System\Windows\Forms\PaddingConverter.cs (4)
52new object[] { padding.Left, padding.Top, padding.Right, padding.Bottom }); 62new object[] { padding.Left, padding.Top, padding.Right, padding.Bottom }); 95(int)propertyValues[nameof(Padding.Top)]!, 115return properties.Sort([nameof(Padding.All), nameof(Padding.Left), nameof(Padding.Top), nameof(Padding.Right), nameof(Padding.Bottom)]);
System.Windows.Forms.Tests (45)
System\Windows\Forms\DockPaddingEdgesTests.cs (5)
51Assert.Equal(expectedValue, owner.Padding.Top); 94Assert.Equal(2, owner.Padding.Top); 137Assert.Equal(expectedTop, owner.Padding.Top); 180Assert.Equal(2, owner.Padding.Top); 223Assert.Equal(2, owner.Padding.Top);
System\Windows\Forms\PaddingConverterTests.cs (19)
151{ nameof(Padding.Top), 2 }, 168{ nameof(Padding.Top), expected.Top }, 190{ nameof(Padding.Top), 2 }, 201{ nameof(Padding.Top), 2 }, 211{ nameof(Padding.Top), 2 }, 223{ nameof(Padding.Top), 2 }, 234{ nameof(Padding.Top), 2 }, 244{ nameof(Padding.Top), 2 }, 256{ nameof(Padding.Top), new object() }, 267{ nameof(Padding.Top), null }, 289{ nameof(Padding.Top), 2 }, 300{ nameof(Padding.Top), 2 }, 311{ nameof(Padding.Top), 2 }, 322{ nameof(Padding.Top), 2 }, 333{ nameof(Padding.Top), 2 }, 344{ nameof(Padding.Top), 2 }, 382{ nameof(Padding.Top), 2 }, 407Assert.Equal(nameof(Padding.Top), properties[2].Name);
System\Windows\Forms\PaddingTests.cs (21)
18Assert.Equal(0, padding.Top); 33Assert.Equal(all, padding.Top); 55Assert.Equal(top, padding.Top); 69Assert.Equal(0, padding.Top); 87Assert.Equal(value, padding.Top); 105Assert.Equal(0, ((Padding)boxedPadding).Top); 125Assert.Equal(0, ((Padding)boxedPadding).Top); 142Assert.Equal(value, padding.Top); 157Assert.Equal(2, padding.Top); 175Assert.Equal(2, ((Padding)boxedPadding).Top); 192Assert.Equal(5, padding.Top); 207Assert.Equal(value, padding.Top); 218PropertyDescriptor property = properties[nameof(Padding.Top)]; 225Assert.Equal(0, ((Padding)boxedPadding).Top); 242Assert.Equal(value, padding.Top); 257Assert.Equal(2, padding.Top); 275Assert.Equal(2, ((Padding)boxedPadding).Top); 292Assert.Equal(5, padding.Top); 307Assert.Equal(2, padding.Top); 325Assert.Equal(2, ((Padding)boxedPadding).Top); 342Assert.Equal(5, padding.Top);