3 writes to _layout
System.Windows.Forms (3)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
448
_layout
= new LayoutData
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (2)
4482
_layout
= newLayout;
4487
_layout
= newLayout;
303 references to _layout
System.Windows.Forms (303)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (24)
1664
_layout
.ColumnHeadersVisible = value;
2462
int displayWidth =
_layout
.Data.Width;
2542
int displayHeight =
_layout
.Data.Height;
2675
int widthNotVisible = Columns.GetColumnsWidth(DataGridViewElementStates.Visible) -
_layout
.Data.Width;
2698
Rectangle rectTmp =
_layout
.Data;
2699
if (
_layout
.ColumnHeadersVisible)
2702
rectTmp = Rectangle.Union(rectTmp,
_layout
.ColumnHeaders);
2797
if (value > 0 && (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) -
_layout
.Data.Width) <= 0)
2969
if (
_layout
._dirty && IsHandleCreated)
2978
return
_layout
;
3352
_layout
.RowHeadersVisible = value;
3408
if (
_layout
.RowHeadersVisible)
3807
if (!
_layout
._dirty && !DesignMode)
3809
Invalidate(Rectangle.Union(
_layout
.Data,
_layout
.ColumnHeaders));
3810
Invalidate(
_layout
.TopLeftHeader);
3860
if (!
_layout
._dirty && !DesignMode)
3862
Invalidate(
_layout
.Data);
3940
if (!
_layout
._dirty && !DesignMode)
3942
Invalidate(
_layout
.RowHeaders);
3949
!
_layout
.ColumnHeadersVisible
3954
!
_layout
.RowHeadersVisible
4070
Invalidate(new Rectangle(
_layout
.Inside.X,
_layout
.Inside.Y, RowHeadersWidth, ColumnHeadersHeight));
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (277)
495
int displayHeight =
_layout
.Data.Height;
539
Debug.Assert(!
_layout
._dirty);
541
if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) >
_layout
.Data.Width)
549
int availableWidth =
_layout
.Data.Width; // Width available for auto-filled columns
595
int maximumPossibleWidth =
_layout
.Data.Width - imposedWidthSum;
749
int maximumPossibleWidth =
_layout
.Data.Width - imposedWidthSum;
926
Debug.Assert(
_layout
.Data.Width ==
_layout
.Inside.Width -
_layout
.RowHeaders.Width - (SingleVerticalBorderAdded ? 1 : 0));
927
int availableWidth =
_layout
.Data.Width - imposedWidthSum;
940
&&
_layout
.Data.Height > totalVisibleFrozenHeight
941
&& SystemInformation.VerticalScrollBarWidth <=
_layout
.Data.Width)
1321
int displayHeight =
_layout
.Data.Height;
1758
if (
_layout
.TopLeftHeader.Width > 0)
1761
? TopLeftHeaderCell.GetPreferredHeight(-1,
_layout
.TopLeftHeader.Width)
1823
if (
_layout
.TopLeftHeader.Width > 0)
1826
? TopLeftHeaderCell.GetPreferredHeight(-1,
_layout
.TopLeftHeader.Width)
2016
if (
_layout
.TopLeftHeader.Width > 0)
2019
? TopLeftHeaderCell.GetPreferredWidth(-1,
_layout
.TopLeftHeader.Height)
2040
int displayHeight =
_layout
.Data.Height, cy = 0;
2178
if (
_layout
.TopLeftHeader.Width > 0)
2181
? TopLeftHeaderCell.GetPreferredWidth(-1,
_layout
.TopLeftHeader.Height)
2202
int displayHeight =
_layout
.Data.Height, cy = 0;
2432
Rectangle clip = Rectangle.Union(
_layout
.ColumnHeaders,
_layout
.Data);
2433
if (
_layout
.TopLeftHeader.Width > 0)
2435
clip = Rectangle.Union(
_layout
.TopLeftHeader, clip);
2456
Rectangle cursorClip =
_layout
.ColumnHeaders;
2467
cursorClip.Width = Math.Min(frozenWidth,
_layout
.Data.Width);
2476
else if (
_layout
.Data.Width > frozenWidth + scrollingWidth)
2478
cursorClip.X +=
_layout
.Data.Width - frozenWidth - scrollingWidth;
2481
cursorClip.Width = Math.Min(scrollingWidth,
_layout
.Data.Width);
2492
Invalidate(
_layout
.ColumnHeaders);
2538
Rectangle clip = Rectangle.Union(
_layout
.ColumnHeaders,
_layout
.Data);
2542
clip.X =
_layout
.Data.X - _mouseBarOffset - 1;
2543
clip.Width = leftEdge - Columns[columnIndex].MinimumThickness -
_layout
.Data.X + 3;
2554
clip.Width =
_layout
.Data.Right - leftEdge - 1;
2740
Rectangle clip = Rectangle.Union(
_layout
.RowHeaders,
_layout
.Data);
2741
if (
_layout
.TopLeftHeader.Width > 0)
2743
clip = Rectangle.Union(
_layout
.TopLeftHeader, clip);
2775
Rectangle clip = Rectangle.Union(
_layout
.RowHeaders,
_layout
.Data);
2778
clip.Height =
_layout
.Data.Y +
_layout
.Data.Height - topEdge - 1;
2971
Rectangle r, inside =
_layout
.ColumnHeaders;
2972
if (
_layout
.TopLeftHeader.Width > 0)
2974
inside = Rectangle.Union(
_layout
.TopLeftHeader, inside);
3003
Rectangle inside =
_layout
.Data;
3024
Rectangle inside =
_layout
.Data;
4217
if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen) >=
_layout
.Data.Width)
4275
int displayHeight =
_layout
.Data.Height - totalVisibleFrozenHeight;
4364
LayoutData newLayout = new(
_layout
);
4365
Rectangle oldResizeRect =
_layout
.ResizeBoxRect;
4388
if (
_layout
.ColumnHeadersVisible)
4402
if (
_layout
.RowHeadersVisible)
4419
if (
_layout
.ColumnHeadersVisible)
4483
_layout
._dirty = false;
4488
Debug.Assert(!
_layout
._dirty);
4496
if (!oldResizeRect.Equals(
_layout
.ResizeBoxRect) && !
_layout
.ResizeBoxRect.IsEmpty)
4498
Invalidate(
_layout
.ResizeBoxRect);
4550
_vertScrollBar.LargeChange =
_layout
.Data.Height - totalVisibleFrozenHeight;
4571
int displayWidth =
_layout
.Data.Width, cx = 0;
4723
Invalidate(
_layout
.ColumnHeaders);
4774
int displayHeight =
_layout
.Data.Height;
4926
columnX = RightToLeftInternal ?
_layout
.RowHeaders.Left - 1 :
_layout
.RowHeaders.Left;
4929
rowY = rowIndex > -1 ? GetRowYFromIndex(rowIndex) :
_layout
.ColumnHeaders.Top;
5525
int cxMax =
_layout
.Data.Width, cx = 0;
5638
Rectangle rectInsertionBar = new(0,
_layout
.ColumnHeaders.Top, InsertionBarWidth,
_layout
.ColumnHeaders.Height);
5666
_layout
.ColumnHeaders.X,
5670
_layout
.ColumnHeaders.Right - InsertionBarWidth);
6052
int y = Math.Min(e.Y + _mouseBarOffset,
_layout
.Data.Bottom - 1);
6053
int delta = y -
_layout
.ColumnHeaders.Y - ColumnHeadersHeight + 1;
6074
Invalidate(Rectangle.Union(
_layout
.TopLeftHeader,
_layout
.ColumnHeaders));
6116
newX = Math.Max(x + _mouseBarOffset,
_layout
.Data.X);
6121
newX = Math.Min(x + _mouseBarOffset,
_layout
.Data.Right - 1);
6299
x = Math.Max(e.X + _mouseBarOffset,
_layout
.Data.Left - 1);
6300
delta =
_layout
.RowHeaders.Right - RowHeadersWidth - x - 1;
6304
x = Math.Min(e.X + _mouseBarOffset,
_layout
.Data.Right - 1);
6305
delta = x -
_layout
.RowHeaders.X - RowHeadersWidth + 1;
6331
int y = Math.Min(e.Y + _mouseBarOffset,
_layout
.Data.Bottom - 1);
6401
int displayHeight =
_layout
.Data.Height;
7059
columnRect = rowIndex >= 0 ?
_layout
.RowHeaders :
_layout
.TopLeftHeader;
7070
rowRect = columnIndex >= 0 ?
_layout
.ColumnHeaders :
_layout
.TopLeftHeader;
8212
Rectangle data =
_layout
.Data;
8310
if (
_layout
.ColumnHeadersVisible)
8312
columnRect.Height +=
_layout
.ColumnHeaders.Height;
8313
columnRect.Y -=
_layout
.ColumnHeaders.Height;
8326
Rectangle data =
_layout
.Data;
8458
int x = RightToLeftInternal ?
_layout
.Data.Right - 1 :
_layout
.Data.X;
8566
Rectangle rectScrollingArea =
_layout
.Data;
8571
int emptyBackgroundWidth = Math.Max(0,
_layout
.Data.Width - Columns.GetColumnsWidth(DataGridViewElementStates.Visible));
8572
int emptyBackgroundHeight = Math.Max(0,
_layout
.Data.Height - frozenVisibleRowsHeight - trailingScrollingRowsHeight);
8580
if (
_layout
.RowHeadersVisible)
8583
rectScrollingArea = Rectangle.Union(rectScrollingArea,
_layout
.RowHeaders);
8672
if (
_layout
.ColumnHeadersVisible)
8675
rectScrollingArea = Rectangle.Union(rectScrollingArea,
_layout
.ColumnHeaders);
8830
if (mouseY <
_layout
.Data.Top)
8832
mouseY =
_layout
.Data.Top + 1;
8895
if (!RightToLeftInternal && mouseX <
_layout
.Data.Left)
8897
mouseX =
_layout
.Data.Left + 1;
8900
else if (RightToLeftInternal && mouseX >
_layout
.Data.Right)
8902
mouseX =
_layout
.Data.Right - 1;
9042
Rectangle data =
_layout
.Data;
9095
if (
_layout
.RowHeadersVisible)
9097
rowRect.Width +=
_layout
.RowHeaders.Width;
9100
rowRect.X -=
_layout
.RowHeaders.Width;
9112
Rectangle data =
_layout
.Data;
9203
int y =
_layout
.Data.Y;
9290
if (!
_layout
.Inside.Contains(x, y))
9307
if (
_layout
.TopLeftHeader.Contains(x, y))
9311
hti._colStart = RightToLeftInternal ?
_layout
.TopLeftHeader.Right - 1 :
_layout
.TopLeftHeader.Left;
9313
hti._rowStart =
_layout
.TopLeftHeader.Top;
9314
if ((!RightToLeftInternal &&
_layout
.TopLeftHeader.Right - x < ColumnSizingHotZone)
9315
|| (RightToLeftInternal && x -
_layout
.TopLeftHeader.Left < ColumnSizingHotZone))
9322
?
_layout
.TopLeftHeader.Left - x - 1
9323
:
_layout
.TopLeftHeader.Right - x - 1;
9326
else if (
_layout
.TopLeftHeader.Top +
_layout
.TopLeftHeader.Height - y < RowSizingHotZone)
9332
hti._mouseBarOffset =
_layout
.TopLeftHeader.Top +
_layout
.TopLeftHeader.Height - y - 1;
9340
if (
_layout
.ColumnHeaders.Contains(x, y))
9352
hti._rowStart =
_layout
.ColumnHeaders.Top;
9403
else if (
_layout
.ColumnHeaders.Bottom - y < RowSizingHotZone)
9409
hti._mouseBarOffset =
_layout
.ColumnHeaders.Bottom - y - 1;
9415
if (
_layout
.RowHeaders.Contains(x, y))
9427
hti._colStart = RightToLeftInternal ?
_layout
.RowHeaders.Right - 1 :
_layout
.RowHeaders.Left;
9467
else if ((!RightToLeftInternal &&
_layout
.RowHeaders.Right - x < ColumnSizingHotZone)
9468
|| (RightToLeftInternal && x -
_layout
.RowHeaders.Left < ColumnSizingHotZone))
9475
?
_layout
.RowHeaders.Left - x - 1
9476
:
_layout
.RowHeaders.Right - x - 1;
9481
if (
_layout
.Data.Contains(x, y))
9833
Invalidate(
_layout
.Data);
9844
Invalidate(
_layout
.Inside);
9901
data =
_layout
.Data;
10174
&& totalVisibleWidth >
_layout
.Data.Width
10175
&& totalVisibleFrozenWidth <
_layout
.Data.Width
10176
&& horizScrollBarHeight <=
_layout
.Data.Height)
10178
int oldDataHeight =
_layout
.Data.Height;
10179
_layout
.Data.Height -= horizScrollBarHeight;
10180
Debug.Assert(
_layout
.Data.Height >= 0);
10182
if (totalVisibleWidth -
_layout
.Data.Width <= vertScrollBarWidth
10183
||
_layout
.Data.Width - totalVisibleFrozenWidth <= vertScrollBarWidth)
10192
needHorizScrollbar = totalVisibleFrozenWidth <
_layout
.Data.Width - vertScrollBarWidth;
10200
if (
_layout
.RowHeadersVisible)
10202
_layout
.RowHeaders.Height -= horizScrollBarHeight;
10203
Debug.Assert(
_layout
.RowHeaders.Height >= 0);
10209
_layout
.Data.Height = oldDataHeight;
10220
&&
_layout
.Data.Height > totalVisibleFrozenHeight
10221
&& vertScrollBarWidth <=
_layout
.Data.Width)
10223
_layout
.Data.Width -= vertScrollBarWidth;
10224
Debug.Assert(
_layout
.Data.Width >= 0);
10227
_layout
.Data.X += vertScrollBarWidth;
10230
if (
_layout
.ColumnHeadersVisible)
10232
_layout
.ColumnHeaders.Width -= vertScrollBarWidth;
10233
Debug.Assert(
_layout
.ColumnHeaders.Width >= 0);
10236
_layout
.ColumnHeaders.X += vertScrollBarWidth;
10250
&& totalVisibleWidth >
_layout
.Data.Width && totalVisibleFrozenWidth <
_layout
.Data.Width
10251
&& horizScrollBarHeight <=
_layout
.Data.Height)
10254
if (
_layout
.ColumnHeadersVisible)
10256
_layout
.ColumnHeaders.Width += vertScrollBarWidth;
10259
_layout
.ColumnHeaders.X -= vertScrollBarWidth;
10263
_layout
.Data.Width += vertScrollBarWidth;
10266
_layout
.Data.X -= vertScrollBarWidth;
10269
_layout
.Data.Height -= horizScrollBarHeight;
10270
Debug.Assert(
_layout
.Data.Height >= 0);
10277
&&
_layout
.Data.Height > totalVisibleFrozenHeight
10278
&& vertScrollBarWidth <=
_layout
.Data.Width)
10280
_layout
.Data.Width -= vertScrollBarWidth;
10281
Debug.Assert(
_layout
.Data.Width >= 0);
10284
_layout
.Data.X += vertScrollBarWidth;
10287
if (
_layout
.ColumnHeadersVisible)
10289
_layout
.ColumnHeaders.Width -= vertScrollBarWidth;
10290
Debug.Assert(
_layout
.ColumnHeaders.Width >= 0);
10293
_layout
.ColumnHeaders.X += vertScrollBarWidth;
10303
_layout
.ResizeBoxRect = default;
10306
_layout
.ResizeBoxRect = new Rectangle(
10307
rightToLeftInternal ?
_layout
.Data.X - _vertScrollBar.Width :
_layout
.Data.Right,
10308
_layout
.Data.Bottom,
10315
int widthNotVisible = totalVisibleWidth -
_layout
.Data.Width;
10324
rightToLeftInternal ?
_layout
.Inside.X +
_layout
.ResizeBoxRect.Width :
_layout
.Inside.X,
10325
_layout
.Data.Bottom,
10326
_layout
.Inside.Width -
_layout
.ResizeBoxRect.Width,
10346
int vertScrollBarTop =
_layout
.Data.Y;
10347
int vertScrollBarHeight =
_layout
.Data.Height;
10348
if (
_layout
.ColumnHeadersVisible)
10350
vertScrollBarTop =
_layout
.ColumnHeaders.Y;
10351
vertScrollBarHeight +=
_layout
.ColumnHeaders.Height;
10363
_vertScrollBar.LargeChange =
_layout
.Data.Height - totalVisibleFrozenHeight;
10365
rightToLeftInternal ?
_layout
.Data.X - _vertScrollBar.Width :
_layout
.Data.Right,
10494
Invalidate(Rectangle.Union(
_layout
.TopLeftHeader,
_layout
.ColumnHeaders));
13439
Invalidate(Rectangle.Union(
_layout
.ColumnHeaders,
_layout
.Data));
13902
Invalidate(Rectangle.Union(
_layout
.TopLeftHeader,
_layout
.ColumnHeaders));
14479
Rectangle rightArea =
_layout
.Data;
14480
if (
_layout
.ColumnHeadersVisible)
14482
rightArea = Rectangle.Union(rightArea,
_layout
.ColumnHeaders);
15211
if (
_layout
._dirty)
16658
if (
_layout
._dirty)
16688
PaintBorder(g, clipRect,
_layout
.ClientRectangle);
16689
if (clipRect.IntersectsWith(
_layout
.ResizeBoxRect))
16691
g.FillRectangle(SystemBrushes.Control,
_layout
.ResizeBoxRect);
16727
Rectangle gridRect =
_layout
.Data;
16728
if (
_layout
.RowHeadersVisible)
16730
gridRect = Rectangle.Union(gridRect,
_layout
.RowHeaders);
16742
if (
_layout
.ColumnHeadersVisible)
16744
gridRect = Rectangle.Union(gridRect,
_layout
.ColumnHeaders);
16748
if (gridRect.Y ==
_layout
.Data.Y)
17427
Rectangle oldClientRectangle =
_layout
.ClientRectangle;
17488
if (!
_layout
.ResizeBoxRect.IsEmpty)
17490
Invalidate(
_layout
.ResizeBoxRect);
17493
_layout
.ClientRectangle = newClientRectangle;
18174
Invalidate(Rectangle.Union(
_layout
.TopLeftHeader,
_layout
.RowHeaders));
19198
if (
_layout
.ColumnHeadersVisible)
19200
rcBelowRows.Y +=
_layout
.ColumnHeaders.Height;
19201
rcBelowRows.Height -=
_layout
.ColumnHeaders.Height;
19223
if (
_layout
.RowHeadersVisible)
19227
rcNextRows.X +=
_layout
.RowHeaders.Width;
19230
rcNextRows.Width -=
_layout
.RowHeaders.Width;
19325
if (g.IsVisible(
_layout
.ColumnHeaders))
19328
bandBounds = cellBounds =
_layout
.ColumnHeaders;
19483
if (
_layout
.TopLeftHeader.Width > 0 && (clipRect.IntersectsWith(
_layout
.TopLeftHeader) || _lastHeaderShadow != -1))
19488
g.SetClip(
_layout
.TopLeftHeader);
19494
if (
_layout
.ColumnHeadersVisible)
19496
Rectangle columnHeadersClip =
_layout
.ColumnHeaders;
19510
int columnHeadersHeight =
_layout
.ColumnHeaders.Height;
19663
if (g.IsVisible(
_layout
.TopLeftHeader))
19668
Rectangle cellBounds =
_layout
.TopLeftHeader;
19674
_layout
.TopLeftHeader,
19744
if (
_layout
is not null)
19746
_layout
._dirty = true;
19796
Rectangle editingZone =
_layout
.Data;
25533
bool matchPositionInCurrencyManagerAfterRecreatingRows = !
_layout
._dirty && !InSortOperation;
25855
Invalidate(Rectangle.Union(
_layout
.TopLeftHeader,
_layout
.ColumnHeaders));
26048
while (xColumnRightEdge <
_layout
.Data.X && Columns.DisplayInOrder(firstDisplayedScrollingColumn, columnIndex))
26057
if (xColumnRightEdge <
_layout
.Data.X)
26069
while (xColumnRightEdge >
_layout
.Data.Right && Columns.DisplayInOrder(firstDisplayedScrollingColumn, columnIndex))
26078
if (xColumnRightEdge >
_layout
.Data.Right)
26277
while (yRowBottomEdge >
_layout
.Data.Bottom && rowIndex > firstDisplayedScrollingRow)
26281
if (yRowBottomEdge >
_layout
.Data.Bottom)
26320
Rectangle rowsRect =
_layout
.Data;
26321
if (
_layout
.RowHeadersVisible)
26323
rowsRect = Rectangle.Union(rowsRect,
_layout
.RowHeaders);
26360
rowsRect.X =
_layout
.Inside.X;
26361
rowsRect.Y =
_layout
.Inside.Y;
26362
rowsRect.Width =
_layout
.RowHeaders.Width;
26716
if (
_layout
.ColumnHeadersVisible)
28923
if (IsHandleCreated &&
_layout
.RowHeadersVisible)
28939
if (IsHandleCreated &&
_layout
.RowHeadersVisible)
28947
Invalidate(
_layout
.RowHeaders);
28991
Rectangle bottomArea =
_layout
.Data;
28992
if (
_layout
.RowHeadersVisible)
28994
bottomArea = Rectangle.Union(bottomArea,
_layout
.RowHeaders);
29066
Rectangle bottomArea =
_layout
.Data;
29067
if (
_layout
.RowHeadersVisible)
29069
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);