3 writes to _layout
System.Windows.Forms (3)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
444
_layout
= new LayoutData
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (2)
4476
_layout
= newLayout;
4481
_layout
= newLayout;
302 references to _layout
System.Windows.Forms (302)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (24)
1670
_layout
.ColumnHeadersVisible = value;
2469
int displayWidth =
_layout
.Data.Width;
2549
int displayHeight =
_layout
.Data.Height;
2682
int widthNotVisible = Columns.GetColumnsWidth(DataGridViewElementStates.Visible) -
_layout
.Data.Width;
2705
Rectangle rectTmp =
_layout
.Data;
2706
if (
_layout
.ColumnHeadersVisible)
2709
rectTmp = Rectangle.Union(rectTmp,
_layout
.ColumnHeaders);
2804
if (value > 0 && (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) -
_layout
.Data.Width) <= 0)
2976
if (
_layout
._dirty && IsHandleCreated)
2985
return
_layout
;
3359
_layout
.RowHeadersVisible = value;
3415
if (
_layout
.RowHeadersVisible)
3814
if (!
_layout
._dirty && !DesignMode)
3816
Invalidate(Rectangle.Union(
_layout
.Data,
_layout
.ColumnHeaders));
3817
Invalidate(
_layout
.TopLeftHeader);
3867
if (!
_layout
._dirty && !DesignMode)
3869
Invalidate(
_layout
.Data);
3947
if (!
_layout
._dirty && !DesignMode)
3949
Invalidate(
_layout
.RowHeaders);
3956
!
_layout
.ColumnHeadersVisible
3961
!
_layout
.RowHeadersVisible
4071
Invalidate(new Rectangle(
_layout
.Inside.X,
_layout
.Inside.Y, RowHeadersWidth, ColumnHeadersHeight));
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (276)
494
int displayHeight =
_layout
.Data.Height;
538
Debug.Assert(!
_layout
._dirty);
540
if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) >
_layout
.Data.Width)
548
int availableWidth =
_layout
.Data.Width; // Width available for auto-filled columns
594
int maximumPossibleWidth =
_layout
.Data.Width - imposedWidthSum;
748
int maximumPossibleWidth =
_layout
.Data.Width - imposedWidthSum;
925
Debug.Assert(
_layout
.Data.Width ==
_layout
.Inside.Width -
_layout
.RowHeaders.Width - (SingleVerticalBorderAdded ? 1 : 0));
926
int availableWidth =
_layout
.Data.Width - imposedWidthSum;
939
&&
_layout
.Data.Height > totalVisibleFrozenHeight
940
&& SystemInformation.VerticalScrollBarWidth <=
_layout
.Data.Width)
1320
int displayHeight =
_layout
.Data.Height;
1757
if (
_layout
.TopLeftHeader.Width > 0)
1760
? TopLeftHeaderCell.GetPreferredHeight(-1,
_layout
.TopLeftHeader.Width)
1822
if (
_layout
.TopLeftHeader.Width > 0)
1825
? TopLeftHeaderCell.GetPreferredHeight(-1,
_layout
.TopLeftHeader.Width)
2015
if (
_layout
.TopLeftHeader.Width > 0)
2018
? TopLeftHeaderCell.GetPreferredWidth(-1,
_layout
.TopLeftHeader.Height)
2039
int displayHeight =
_layout
.Data.Height, cy = 0;
2177
if (
_layout
.TopLeftHeader.Width > 0)
2180
? TopLeftHeaderCell.GetPreferredWidth(-1,
_layout
.TopLeftHeader.Height)
2201
int displayHeight =
_layout
.Data.Height, cy = 0;
2431
Rectangle clip = Rectangle.Union(
_layout
.ColumnHeaders,
_layout
.Data);
2432
if (
_layout
.TopLeftHeader.Width > 0)
2434
clip = Rectangle.Union(
_layout
.TopLeftHeader, clip);
2455
Rectangle cursorClip =
_layout
.ColumnHeaders;
2466
cursorClip.Width = Math.Min(frozenWidth,
_layout
.Data.Width);
2475
else if (
_layout
.Data.Width > frozenWidth + scrollingWidth)
2477
cursorClip.X +=
_layout
.Data.Width - frozenWidth - scrollingWidth;
2480
cursorClip.Width = Math.Min(scrollingWidth,
_layout
.Data.Width);
2491
Invalidate(
_layout
.ColumnHeaders);
2537
Rectangle clip = Rectangle.Union(
_layout
.ColumnHeaders,
_layout
.Data);
2541
clip.X =
_layout
.Data.X - _mouseBarOffset - 1;
2542
clip.Width = leftEdge - Columns[columnIndex].MinimumThickness -
_layout
.Data.X + 3;
2553
clip.Width =
_layout
.Data.Right - leftEdge - 1;
2736
Rectangle clip = Rectangle.Union(
_layout
.RowHeaders,
_layout
.Data);
2737
if (
_layout
.TopLeftHeader.Width > 0)
2739
clip = Rectangle.Union(
_layout
.TopLeftHeader, clip);
2771
Rectangle clip = Rectangle.Union(
_layout
.RowHeaders,
_layout
.Data);
2774
clip.Height =
_layout
.Data.Y +
_layout
.Data.Height - topEdge - 1;
2967
Rectangle r, inside =
_layout
.ColumnHeaders;
2968
if (
_layout
.TopLeftHeader.Width > 0)
2970
inside = Rectangle.Union(
_layout
.TopLeftHeader, inside);
2999
Rectangle inside =
_layout
.Data;
3020
Rectangle inside =
_layout
.Data;
4211
if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen) >=
_layout
.Data.Width)
4269
int displayHeight =
_layout
.Data.Height - totalVisibleFrozenHeight;
4358
LayoutData newLayout = new(
_layout
);
4359
Rectangle oldResizeRect =
_layout
.ResizeBoxRect;
4382
if (
_layout
.ColumnHeadersVisible)
4396
if (
_layout
.RowHeadersVisible)
4413
if (
_layout
.ColumnHeadersVisible)
4477
_layout
._dirty = false;
4482
Debug.Assert(!
_layout
._dirty);
4490
if (!oldResizeRect.Equals(
_layout
.ResizeBoxRect) && !
_layout
.ResizeBoxRect.IsEmpty)
4492
Invalidate(
_layout
.ResizeBoxRect);
4544
_vertScrollBar.LargeChange =
_layout
.Data.Height - totalVisibleFrozenHeight;
4565
int displayWidth =
_layout
.Data.Width, cx = 0;
4717
Invalidate(
_layout
.ColumnHeaders);
4768
int displayHeight =
_layout
.Data.Height;
4920
columnX = RightToLeftInternal ?
_layout
.RowHeaders.Left - 1 :
_layout
.RowHeaders.Left;
4923
rowY = rowIndex > -1 ? GetRowYFromIndex(rowIndex) :
_layout
.ColumnHeaders.Top;
5519
int cxMax =
_layout
.Data.Width, cx = 0;
5632
Rectangle rectInsertionBar = new(0,
_layout
.ColumnHeaders.Top, InsertionBarWidth,
_layout
.ColumnHeaders.Height);
5660
_layout
.ColumnHeaders.X,
5664
_layout
.ColumnHeaders.Right - InsertionBarWidth);
6046
int y = Math.Min(e.Y + _mouseBarOffset,
_layout
.Data.Bottom - 1);
6047
int delta = y -
_layout
.ColumnHeaders.Y - ColumnHeadersHeight + 1;
6068
Invalidate(Rectangle.Union(
_layout
.TopLeftHeader,
_layout
.ColumnHeaders));
6110
newX = Math.Max(x + _mouseBarOffset,
_layout
.Data.X);
6115
newX = Math.Min(x + _mouseBarOffset,
_layout
.Data.Right - 1);
6293
x = Math.Max(e.X + _mouseBarOffset,
_layout
.Data.Left - 1);
6294
delta =
_layout
.RowHeaders.Right - RowHeadersWidth - x - 1;
6298
x = Math.Min(e.X + _mouseBarOffset,
_layout
.Data.Right - 1);
6299
delta = x -
_layout
.RowHeaders.X - RowHeadersWidth + 1;
6325
int y = Math.Min(e.Y + _mouseBarOffset,
_layout
.Data.Bottom - 1);
6395
int displayHeight =
_layout
.Data.Height;
7053
columnRect = rowIndex >= 0 ?
_layout
.RowHeaders :
_layout
.TopLeftHeader;
7064
rowRect = columnIndex >= 0 ?
_layout
.ColumnHeaders :
_layout
.TopLeftHeader;
8207
Rectangle data =
_layout
.Data;
8305
if (
_layout
.ColumnHeadersVisible)
8307
columnRect.Height +=
_layout
.ColumnHeaders.Height;
8308
columnRect.Y -=
_layout
.ColumnHeaders.Height;
8321
Rectangle data =
_layout
.Data;
8453
int x = RightToLeftInternal ?
_layout
.Data.Right - 1 :
_layout
.Data.X;
8561
Rectangle rectScrollingArea =
_layout
.Data;
8566
int emptyBackgroundWidth = Math.Max(0,
_layout
.Data.Width - Columns.GetColumnsWidth(DataGridViewElementStates.Visible));
8567
int emptyBackgroundHeight = Math.Max(0,
_layout
.Data.Height - frozenVisibleRowsHeight - trailingScrollingRowsHeight);
8575
if (
_layout
.RowHeadersVisible)
8578
rectScrollingArea = Rectangle.Union(rectScrollingArea,
_layout
.RowHeaders);
8667
if (
_layout
.ColumnHeadersVisible)
8670
rectScrollingArea = Rectangle.Union(rectScrollingArea,
_layout
.ColumnHeaders);
8825
if (mouseY <
_layout
.Data.Top)
8827
mouseY =
_layout
.Data.Top + 1;
8890
if (!RightToLeftInternal && mouseX <
_layout
.Data.Left)
8892
mouseX =
_layout
.Data.Left + 1;
8895
else if (RightToLeftInternal && mouseX >
_layout
.Data.Right)
8897
mouseX =
_layout
.Data.Right - 1;
9037
Rectangle data =
_layout
.Data;
9090
if (
_layout
.RowHeadersVisible)
9092
rowRect.Width +=
_layout
.RowHeaders.Width;
9095
rowRect.X -=
_layout
.RowHeaders.Width;
9107
Rectangle data =
_layout
.Data;
9198
int y =
_layout
.Data.Y;
9285
if (!
_layout
.Inside.Contains(x, y))
9302
if (
_layout
.TopLeftHeader.Contains(x, y))
9306
hti._colStart = RightToLeftInternal ?
_layout
.TopLeftHeader.Right - 1 :
_layout
.TopLeftHeader.Left;
9308
hti._rowStart =
_layout
.TopLeftHeader.Top;
9309
if ((!RightToLeftInternal &&
_layout
.TopLeftHeader.Right - x < ColumnSizingHotZone)
9310
|| (RightToLeftInternal && x -
_layout
.TopLeftHeader.Left < ColumnSizingHotZone))
9317
?
_layout
.TopLeftHeader.Left - x - 1
9318
:
_layout
.TopLeftHeader.Right - x - 1;
9321
else if (
_layout
.TopLeftHeader.Top +
_layout
.TopLeftHeader.Height - y < RowSizingHotZone)
9327
hti._mouseBarOffset =
_layout
.TopLeftHeader.Top +
_layout
.TopLeftHeader.Height - y - 1;
9335
if (
_layout
.ColumnHeaders.Contains(x, y))
9347
hti._rowStart =
_layout
.ColumnHeaders.Top;
9398
else if (
_layout
.ColumnHeaders.Bottom - y < RowSizingHotZone)
9404
hti._mouseBarOffset =
_layout
.ColumnHeaders.Bottom - y - 1;
9410
if (
_layout
.RowHeaders.Contains(x, y))
9422
hti._colStart = RightToLeftInternal ?
_layout
.RowHeaders.Right - 1 :
_layout
.RowHeaders.Left;
9462
else if ((!RightToLeftInternal &&
_layout
.RowHeaders.Right - x < ColumnSizingHotZone)
9463
|| (RightToLeftInternal && x -
_layout
.RowHeaders.Left < ColumnSizingHotZone))
9470
?
_layout
.RowHeaders.Left - x - 1
9471
:
_layout
.RowHeaders.Right - x - 1;
9476
if (
_layout
.Data.Contains(x, y))
9828
Invalidate(
_layout
.Data);
9839
Invalidate(
_layout
.Inside);
9896
data =
_layout
.Data;
10169
&& totalVisibleWidth >
_layout
.Data.Width
10170
&& totalVisibleFrozenWidth <
_layout
.Data.Width
10171
&& horizScrollBarHeight <=
_layout
.Data.Height)
10173
int oldDataHeight =
_layout
.Data.Height;
10174
_layout
.Data.Height -= horizScrollBarHeight;
10175
Debug.Assert(
_layout
.Data.Height >= 0);
10177
if (totalVisibleWidth -
_layout
.Data.Width <= vertScrollBarWidth
10178
||
_layout
.Data.Width - totalVisibleFrozenWidth <= vertScrollBarWidth)
10187
needHorizScrollbar = totalVisibleFrozenWidth <
_layout
.Data.Width - vertScrollBarWidth;
10195
if (
_layout
.RowHeadersVisible)
10197
_layout
.RowHeaders.Height -= horizScrollBarHeight;
10198
Debug.Assert(
_layout
.RowHeaders.Height >= 0);
10204
_layout
.Data.Height = oldDataHeight;
10215
&&
_layout
.Data.Height > totalVisibleFrozenHeight
10216
&& vertScrollBarWidth <=
_layout
.Data.Width)
10218
_layout
.Data.Width -= vertScrollBarWidth;
10219
Debug.Assert(
_layout
.Data.Width >= 0);
10222
_layout
.Data.X += vertScrollBarWidth;
10225
if (
_layout
.ColumnHeadersVisible)
10227
_layout
.ColumnHeaders.Width -= vertScrollBarWidth;
10228
Debug.Assert(
_layout
.ColumnHeaders.Width >= 0);
10231
_layout
.ColumnHeaders.X += vertScrollBarWidth;
10245
&& totalVisibleWidth >
_layout
.Data.Width && totalVisibleFrozenWidth <
_layout
.Data.Width
10246
&& horizScrollBarHeight <=
_layout
.Data.Height)
10249
if (
_layout
.ColumnHeadersVisible)
10251
_layout
.ColumnHeaders.Width += vertScrollBarWidth;
10254
_layout
.ColumnHeaders.X -= vertScrollBarWidth;
10258
_layout
.Data.Width += vertScrollBarWidth;
10261
_layout
.Data.X -= vertScrollBarWidth;
10264
_layout
.Data.Height -= horizScrollBarHeight;
10265
Debug.Assert(
_layout
.Data.Height >= 0);
10272
&&
_layout
.Data.Height > totalVisibleFrozenHeight
10273
&& vertScrollBarWidth <=
_layout
.Data.Width)
10275
_layout
.Data.Width -= vertScrollBarWidth;
10276
Debug.Assert(
_layout
.Data.Width >= 0);
10279
_layout
.Data.X += vertScrollBarWidth;
10282
if (
_layout
.ColumnHeadersVisible)
10284
_layout
.ColumnHeaders.Width -= vertScrollBarWidth;
10285
Debug.Assert(
_layout
.ColumnHeaders.Width >= 0);
10288
_layout
.ColumnHeaders.X += vertScrollBarWidth;
10298
_layout
.ResizeBoxRect = default;
10301
_layout
.ResizeBoxRect = new Rectangle(
10302
rightToLeftInternal ?
_layout
.Data.X - _vertScrollBar.Width :
_layout
.Data.Right,
10303
_layout
.Data.Bottom,
10310
int widthNotVisible = totalVisibleWidth -
_layout
.Data.Width;
10319
rightToLeftInternal ?
_layout
.Inside.X +
_layout
.ResizeBoxRect.Width :
_layout
.Inside.X,
10320
_layout
.Data.Bottom,
10321
_layout
.Inside.Width -
_layout
.ResizeBoxRect.Width,
10341
int vertScrollBarTop =
_layout
.Data.Y;
10342
int vertScrollBarHeight =
_layout
.Data.Height;
10343
if (
_layout
.ColumnHeadersVisible)
10345
vertScrollBarTop =
_layout
.ColumnHeaders.Y;
10346
vertScrollBarHeight +=
_layout
.ColumnHeaders.Height;
10358
_vertScrollBar.LargeChange =
_layout
.Data.Height - totalVisibleFrozenHeight;
10360
rightToLeftInternal ?
_layout
.Data.X - _vertScrollBar.Width :
_layout
.Data.Right,
10489
Invalidate(Rectangle.Union(
_layout
.TopLeftHeader,
_layout
.ColumnHeaders));
13447
Invalidate(Rectangle.Union(
_layout
.ColumnHeaders,
_layout
.Data));
13910
Invalidate(Rectangle.Union(
_layout
.TopLeftHeader,
_layout
.ColumnHeaders));
14487
Rectangle rightArea =
_layout
.Data;
14488
if (
_layout
.ColumnHeadersVisible)
14490
rightArea = Rectangle.Union(rightArea,
_layout
.ColumnHeaders);
15220
if (
_layout
._dirty)
16668
if (
_layout
._dirty)
16698
PaintBorder(g, clipRect,
_layout
.ClientRectangle);
16699
if (clipRect.IntersectsWith(
_layout
.ResizeBoxRect))
16701
g.FillRectangle(SystemBrushes.Control,
_layout
.ResizeBoxRect);
16737
Rectangle gridRect =
_layout
.Data;
16738
if (
_layout
.RowHeadersVisible)
16740
gridRect = Rectangle.Union(gridRect,
_layout
.RowHeaders);
16752
if (
_layout
.ColumnHeadersVisible)
16754
gridRect = Rectangle.Union(gridRect,
_layout
.ColumnHeaders);
16758
if (gridRect.Y ==
_layout
.Data.Y)
17437
Rectangle oldClientRectangle =
_layout
.ClientRectangle;
17498
if (!
_layout
.ResizeBoxRect.IsEmpty)
17500
Invalidate(
_layout
.ResizeBoxRect);
17503
_layout
.ClientRectangle = newClientRectangle;
18184
Invalidate(Rectangle.Union(
_layout
.TopLeftHeader,
_layout
.RowHeaders));
19208
if (
_layout
.ColumnHeadersVisible)
19210
rcBelowRows.Y +=
_layout
.ColumnHeaders.Height;
19211
rcBelowRows.Height -=
_layout
.ColumnHeaders.Height;
19233
if (
_layout
.RowHeadersVisible)
19237
rcNextRows.X +=
_layout
.RowHeaders.Width;
19240
rcNextRows.Width -=
_layout
.RowHeaders.Width;
19335
if (g.IsVisible(
_layout
.ColumnHeaders))
19338
bandBounds = cellBounds =
_layout
.ColumnHeaders;
19494
if (
_layout
.TopLeftHeader.Width > 0 && (clipRect.IntersectsWith(
_layout
.TopLeftHeader) || _lastHeaderShadow != -1))
19499
g.SetClip(
_layout
.TopLeftHeader);
19505
if (
_layout
.ColumnHeadersVisible)
19507
Rectangle columnHeadersClip =
_layout
.ColumnHeaders;
19521
int columnHeadersHeight =
_layout
.ColumnHeaders.Height;
19674
if (g.IsVisible(
_layout
.TopLeftHeader))
19679
Rectangle cellBounds =
_layout
.TopLeftHeader;
19685
_layout
.TopLeftHeader,
19755
_layout
?._dirty = true;
19804
Rectangle editingZone =
_layout
.Data;
25541
bool matchPositionInCurrencyManagerAfterRecreatingRows = !
_layout
._dirty && !InSortOperation;
25863
Invalidate(Rectangle.Union(
_layout
.TopLeftHeader,
_layout
.ColumnHeaders));
26056
while (xColumnRightEdge <
_layout
.Data.X && Columns.DisplayInOrder(firstDisplayedScrollingColumn, columnIndex))
26065
if (xColumnRightEdge <
_layout
.Data.X)
26077
while (xColumnRightEdge >
_layout
.Data.Right && Columns.DisplayInOrder(firstDisplayedScrollingColumn, columnIndex))
26086
if (xColumnRightEdge >
_layout
.Data.Right)
26285
while (yRowBottomEdge >
_layout
.Data.Bottom && rowIndex > firstDisplayedScrollingRow)
26289
if (yRowBottomEdge >
_layout
.Data.Bottom)
26328
Rectangle rowsRect =
_layout
.Data;
26329
if (
_layout
.RowHeadersVisible)
26331
rowsRect = Rectangle.Union(rowsRect,
_layout
.RowHeaders);
26368
rowsRect.X =
_layout
.Inside.X;
26369
rowsRect.Y =
_layout
.Inside.Y;
26370
rowsRect.Width =
_layout
.RowHeaders.Width;
26723
if (
_layout
.ColumnHeadersVisible)
28931
if (IsHandleCreated &&
_layout
.RowHeadersVisible)
28947
if (IsHandleCreated &&
_layout
.RowHeadersVisible)
28955
Invalidate(
_layout
.RowHeaders);
28999
Rectangle bottomArea =
_layout
.Data;
29000
if (
_layout
.RowHeadersVisible)
29002
bottomArea = Rectangle.Union(bottomArea,
_layout
.RowHeaders);
29074
Rectangle bottomArea =
_layout
.Data;
29075
if (
_layout
.RowHeadersVisible)
29077
bottomArea = Rectangle.Union(bottomArea,
_layout
.RowHeaders);
System\Windows\Forms\Controls\DataGridView\DataGridView.TopRowAccessibleObject.cs (2)
37
Rectangle rect = Rectangle.Union(_ownerDataGridView.
_layout
.ColumnHeaders, _ownerDataGridView.
_layout
.TopLeftHeader);