27 writes to Top
System.Windows.Forms (24)
System\Windows\Forms\Control.cs (2)
9704
padding.
Top
= (int)Math.Round(padding.Top * dy);
9706
margins.
Top
= (int)Math.Round(margins.Top * dy);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (1)
277
value.
Top
= Math.Max(0, value.Top);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (1)
144
padding.
Top
= 0;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (17)
121
cellMargin.
Top
-= spaceToFree;
128
cellMargin.
Top
= 0;
198
cellMargin.
Top
-= requiredSpace;
205
cellMargin.
Top
= 0;
219
cellMargin.
Top
+= spaceToFree;
267
cellMargin.
Top
-= requiredSpace;
274
cellMargin.
Top
= 0;
302
cellMargin.
Top
+= spaceToFree;
332
cellMargin.
Top
+= freedSpace;
370
cellMargin.
Top
-= spaceToFree;
378
cellMargin.
Top
= 0;
472
nextCellMargin.
Top
-= requiredSpace;
490
nextCellMargin.
Top
-= freedSpace;
506
lastCellMargin.
Top
= Math.Max(0, locationToDrag.Y - nextCell.Bounds.Bottom);
527
newCellMargin.
Top
= freedSpace - controlToDragWidth;
547
cellMargin.
Top
= Math.Max(0, locationToDrag.Y - Row.Margin.Top);
580
nextCellMargin.
Top
+= spaceOccupiedByCell;
System\Windows\Forms\Layout\LayoutUtils.cs (2)
146
padding.
Top
= Math.Max(0, padding.Top);
423
padding.
Top
= padding.Left;
System\Windows\Forms\Scrolling\ScrollableControl.DockPaddingEdgesConverter.cs (1)
179
padding.
Top
= value;
System.Windows.Forms.Primitives (1)
System\Windows\Forms\Padding.cs (1)
179
private void ResetTop() =>
Top
= 0;
System.Windows.Forms.Tests (2)
System\Windows\Forms\PaddingTests.cs (2)
203
Top
= value
238
Top
= value
145 references to Top
PresentationUI (11)
MS\Internal\Documents\SignatureSummaryDialog.cs (11)
577
return h + CellPadding.
Top
+ CellPadding.Bottom;
661
bounds.Y + CellPadding.
Top
,
663
bounds.Height - CellPadding.
Top
- CellPadding.Bottom
671
bounds.Y + CellPadding.
Top
,
673
bounds.Height - CellPadding.
Top
- CellPadding.Bottom
679
bounds.Y + CellPadding.
Top
,
681
bounds.Height - CellPadding.
Top
- CellPadding.Bottom
706
bounds.Y + CellPadding.
Top
,
708
bounds.Height - CellPadding.
Top
- CellPadding.Bottom
714
bounds.Y + CellPadding.
Top
,
716
bounds.Height - CellPadding.
Top
- CellPadding.Bottom
System.Windows.Forms (67)
System\Windows\Forms\Control.cs (2)
9704
padding.Top = (int)Math.Round(padding.
Top
* dy);
9706
margins.Top = (int)Math.Round(margins.
Top
* dy);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (2)
700
valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.
Top
);
704
valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.
Top
);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (2)
3617
rectPadding.Height = cellStyle.Padding.
Top
;
3805
borderAndPaddingWidths.Y += cellStyle.Padding.
Top
;
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (3)
266
if (value.Left < 0 || value.Right < 0 || value.
Top
< 0 || value.Bottom < 0)
277
value.Top = Math.Max(0, value.
Top
);
292
Debug.Assert(value.
Top
>= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (2)
1123
valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.
Top
);
1127
valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.
Top
);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (4)
781
valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.
Top
);
785
valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.
Top
);
881
valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.
Top
);
885
valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.
Top
);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (3)
533
borderAndPaddingWidths.Y += cellStyle.Padding.
Top
;
1945
valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.
Top
);
1949
valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.
Top
);
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
770
cellStyle.Padding.
Top
);
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (2)
927
valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.
Top
);
931
valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.
Top
);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (4)
662
valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.
Top
);
666
valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.
Top
);
746
valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.
Top
);
750
valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.
Top
);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (2)
695
valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.
Top
);
699
valBounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.
Top
);
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (2)
285
valBounds.Offset(cellStyle.Padding.Right, cellStyle.Padding.
Top
);
289
valBounds.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)
4179
gripRectangle.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)
99
rect = LayoutUtils.InflateRect(rect, new Padding(0, Padding.
Top
, 0, Padding.Bottom));
363
nextPoint = new Point(_checkPadding.Left, _checkPadding.
Top
);
368
nextPoint.Y = _imagePadding.
Top
;
378
nextPoint = new Point(1, _checkPadding.
Top
);
398
nextPoint = new Point(1, _checkPadding.
Top
);
420
nextPoint.Y = _textPadding.
Top
;
425
nextPoint.Y = _arrowPadding.
Top
;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (2)
530
margins[i] = c.Margin.
Top
;
540
cachedBounds.X = Math.Max(0, cachedBounds.X - margins[i] - c.Margin.
Top
);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (1)
67
dragBounds.Height += (nextRowBounds.Height >> 2) + Row.Margin.Bottom + ToolStripPanel.RowsInternal[index + 1].Margin.
Top
;
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (8)
72
dragBounds.Y -= Row.Margin.
Top
+ ToolStripPanel.Padding.
Top
+ 4;
119
if (cellMargin.
Top
>= spaceToFree)
127
spaceToFree -= lastCellOnRow.Margin.
Top
;
368
if (cellMargin.
Top
>= spaceToFree)
377
spaceToFree -= lastCellOnRow.Margin.
Top
;
470
if (nextCellMargin.
Top
> requiredSpace)
547
cellMargin.Top = Math.Max(0, locationToDrag.Y - Row.Margin.
Top
);
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (2)
149
insertionRect = new Rectangle(item.Bounds.Right, _owner.Margin.
Top
, ToolStrip.s_insertionBeamWidth, _owner.Height - (_owner.Margin.Vertical) - 1);
152
insertionRect = 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)
299
y += itemMargin.
Top
;
312
y += itemMargin.
Top
;
437
lastBottom = y - itemMargin.
Top
;
444
y = lastTop + itemMargin.
Top
;
System\Windows\Forms\Layout\ArrangedElement.cs (2)
74
Debug.Assert((value.Right >= 0 && value.Left >= 0 && value.
Top
>= 0 && value.Bottom >= 0), "who's setting margin negative?");
86
Debug.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)
678
preferredSizeForAnchoring.Height -= containerPadding.
Top
;
System\Windows\Forms\Layout\FlowLayout.cs (2)
321
Debug.Assert(container.Children[0].Bounds.Y == margin.
Top
+ container.DisplayRectangle.Y);
326
Debug.Assert(container.Children[0].Bounds.Y == margin.
Top
+ container.DisplayRectangle.Y);
System\Windows\Forms\Layout\LayoutUtils.cs (4)
146
padding.Top = Math.Max(0, padding.
Top
);
375
rect.Y -= padding.
Top
;
384
rect.Y += padding.
Top
;
422
temp = padding.
Top
;
System\Windows\Forms\Scrolling\ScrollableControl.DockPaddingEdgesConverter.cs (2)
67
|| _owner.Padding.
Top
!= -1
169
get => _owner is null ? _top : _owner.Padding.
Top
;
System.Windows.Forms.Design (4)
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (1)
175
lines.Add(new SnapLine(SnapLineType.Horizontal, loc.Y - _primaryControl.Margin.
Top
, SnapLine.MarginTop, SnapLinePriority.Always));
System\Windows\Forms\Design\ControlDesigner.cs (1)
360
snapLines.Add(new SnapLine(SnapLineType.Horizontal, -margin.
Top
, SnapLine.MarginTop, SnapLinePriority.Always));
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (2)
154
bounds.Top - margin.
Top
,
220
bounds.Y -= margin.
Top
;
System.Windows.Forms.Primitives (18)
System\Windows\Forms\Internals\ScaleHelper.cs (1)
287
ScaleToDpi(logicalPadding.
Top
, dpi),
System\Windows\Forms\Padding.cs (13)
125
public readonly int Vertical =>
Top
+ Bottom;
140
&&
Top
== other.
Top
148
new(p1.Left + p2.Left, p1.
Top
+ p2.
Top
, p1.Right + p2.Right, p1.Bottom + p2.Bottom);
154
new(p1.Left - p2.Left, p1.
Top
- p2.
Top
, p1.Right - p2.Right, p1.Bottom - p2.Bottom);
160
p1.Left == p2.Left && p1.
Top
== p2.
Top
&& p1.Right == p2.Right && p1.Bottom == p2.Bottom;
167
public override readonly int GetHashCode() => HashCode.Combine(Left,
Top
, Right, Bottom);
169
public override readonly string ToString() => $"{{Left={Left},Top={
Top
},Right={Right},Bottom={Bottom}}}";
197
Debug.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)
52
new object[] { padding.Left, padding.
Top
, padding.Right, padding.Bottom });
62
new object[] { padding.Left, padding.
Top
, padding.Right, padding.Bottom });
95
(int)propertyValues[nameof(Padding.
Top
)]!,
115
return 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)
51
Assert.Equal(expectedValue, owner.Padding.
Top
);
94
Assert.Equal(2, owner.Padding.
Top
);
137
Assert.Equal(expectedTop, owner.Padding.
Top
);
180
Assert.Equal(2, owner.Padding.
Top
);
223
Assert.Equal(2, owner.Padding.
Top
);
System\Windows\Forms\PaddingConverterTests.cs (19)
150
{ nameof(Padding.
Top
), 2 },
167
{ nameof(Padding.
Top
), expected.
Top
},
189
{ nameof(Padding.
Top
), 2 },
200
{ nameof(Padding.
Top
), 2 },
210
{ nameof(Padding.
Top
), 2 },
222
{ nameof(Padding.
Top
), 2 },
233
{ nameof(Padding.
Top
), 2 },
243
{ nameof(Padding.
Top
), 2 },
255
{ nameof(Padding.
Top
), new object() },
266
{ nameof(Padding.
Top
), null },
288
{ nameof(Padding.
Top
), 2 },
299
{ nameof(Padding.
Top
), 2 },
310
{ nameof(Padding.
Top
), 2 },
321
{ nameof(Padding.
Top
), 2 },
332
{ nameof(Padding.
Top
), 2 },
343
{ nameof(Padding.
Top
), 2 },
381
{ nameof(Padding.
Top
), 2 },
406
Assert.Equal(nameof(Padding.
Top
), properties[2].Name);
System\Windows\Forms\PaddingTests.cs (21)
18
Assert.Equal(0, padding.
Top
);
33
Assert.Equal(all, padding.
Top
);
55
Assert.Equal(top, padding.
Top
);
69
Assert.Equal(0, padding.
Top
);
87
Assert.Equal(value, padding.
Top
);
105
Assert.Equal(0, ((Padding)boxedPadding).
Top
);
125
Assert.Equal(0, ((Padding)boxedPadding).
Top
);
142
Assert.Equal(value, padding.
Top
);
157
Assert.Equal(2, padding.
Top
);
175
Assert.Equal(2, ((Padding)boxedPadding).
Top
);
192
Assert.Equal(5, padding.
Top
);
207
Assert.Equal(value, padding.
Top
);
218
PropertyDescriptor property = properties[nameof(Padding.
Top
)];
225
Assert.Equal(0, ((Padding)boxedPadding).
Top
);
242
Assert.Equal(value, padding.
Top
);
257
Assert.Equal(2, padding.
Top
);
275
Assert.Equal(2, ((Padding)boxedPadding).
Top
);
292
Assert.Equal(5, padding.
Top
);
307
Assert.Equal(2, padding.
Top
);
325
Assert.Equal(2, ((Padding)boxedPadding).
Top
);
342
Assert.Equal(5, padding.
Top
);