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)
4479_layout = newLayout; 4484_layout = newLayout;
302 references to _layout
System.Windows.Forms (302)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (24)
1671_layout.ColumnHeadersVisible = value; 2470int displayWidth = _layout.Data.Width; 2550int displayHeight = _layout.Data.Height; 2683int widthNotVisible = Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - _layout.Data.Width; 2706Rectangle rectTmp = _layout.Data; 2707if (_layout.ColumnHeadersVisible) 2710rectTmp = Rectangle.Union(rectTmp, _layout.ColumnHeaders); 2805if (value > 0 && (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - _layout.Data.Width) <= 0) 2977if (_layout._dirty && IsHandleCreated) 2986return _layout; 3360_layout.RowHeadersVisible = value; 3416if (_layout.RowHeadersVisible) 3815if (!_layout._dirty && !DesignMode) 3817Invalidate(Rectangle.Union(_layout.Data, _layout.ColumnHeaders)); 3818Invalidate(_layout.TopLeftHeader); 3868if (!_layout._dirty && !DesignMode) 3870Invalidate(_layout.Data); 3948if (!_layout._dirty && !DesignMode) 3950Invalidate(_layout.RowHeaders); 3957!_layout.ColumnHeadersVisible 3962!_layout.RowHeadersVisible 4072Invalidate(new Rectangle(_layout.Inside.X, _layout.Inside.Y, RowHeadersWidth, ColumnHeadersHeight));
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (276)
494int displayHeight = _layout.Data.Height; 538Debug.Assert(!_layout._dirty); 540if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) > _layout.Data.Width) 548int availableWidth = _layout.Data.Width; // Width available for auto-filled columns 594int maximumPossibleWidth = _layout.Data.Width - imposedWidthSum; 748int maximumPossibleWidth = _layout.Data.Width - imposedWidthSum; 925Debug.Assert(_layout.Data.Width == _layout.Inside.Width - _layout.RowHeaders.Width - (SingleVerticalBorderAdded ? 1 : 0)); 926int availableWidth = _layout.Data.Width - imposedWidthSum; 939&& _layout.Data.Height > totalVisibleFrozenHeight 940&& SystemInformation.VerticalScrollBarWidth <= _layout.Data.Width) 1320int displayHeight = _layout.Data.Height; 1757if (_layout.TopLeftHeader.Width > 0) 1760? TopLeftHeaderCell.GetPreferredHeight(-1, _layout.TopLeftHeader.Width) 1822if (_layout.TopLeftHeader.Width > 0) 1825? TopLeftHeaderCell.GetPreferredHeight(-1, _layout.TopLeftHeader.Width) 2015if (_layout.TopLeftHeader.Width > 0) 2018? TopLeftHeaderCell.GetPreferredWidth(-1, _layout.TopLeftHeader.Height) 2039int displayHeight = _layout.Data.Height, cy = 0; 2177if (_layout.TopLeftHeader.Width > 0) 2180? TopLeftHeaderCell.GetPreferredWidth(-1, _layout.TopLeftHeader.Height) 2201int displayHeight = _layout.Data.Height, cy = 0; 2431Rectangle clip = Rectangle.Union(_layout.ColumnHeaders, _layout.Data); 2432if (_layout.TopLeftHeader.Width > 0) 2434clip = Rectangle.Union(_layout.TopLeftHeader, clip); 2455Rectangle cursorClip = _layout.ColumnHeaders; 2466cursorClip.Width = Math.Min(frozenWidth, _layout.Data.Width); 2475else if (_layout.Data.Width > frozenWidth + scrollingWidth) 2477cursorClip.X += _layout.Data.Width - frozenWidth - scrollingWidth; 2480cursorClip.Width = Math.Min(scrollingWidth, _layout.Data.Width); 2491Invalidate(_layout.ColumnHeaders); 2537Rectangle clip = Rectangle.Union(_layout.ColumnHeaders, _layout.Data); 2541clip.X = _layout.Data.X - _mouseBarOffset - 1; 2542clip.Width = leftEdge - Columns[columnIndex].MinimumThickness - _layout.Data.X + 3; 2553clip.Width = _layout.Data.Right - leftEdge - 1; 2739Rectangle clip = Rectangle.Union(_layout.RowHeaders, _layout.Data); 2740if (_layout.TopLeftHeader.Width > 0) 2742clip = Rectangle.Union(_layout.TopLeftHeader, clip); 2774Rectangle clip = Rectangle.Union(_layout.RowHeaders, _layout.Data); 2777clip.Height = _layout.Data.Y + _layout.Data.Height - topEdge - 1; 2970Rectangle r, inside = _layout.ColumnHeaders; 2971if (_layout.TopLeftHeader.Width > 0) 2973inside = Rectangle.Union(_layout.TopLeftHeader, inside); 3002Rectangle inside = _layout.Data; 3023Rectangle inside = _layout.Data; 4214if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen) >= _layout.Data.Width) 4272int displayHeight = _layout.Data.Height - totalVisibleFrozenHeight; 4361LayoutData newLayout = new(_layout); 4362Rectangle oldResizeRect = _layout.ResizeBoxRect; 4385if (_layout.ColumnHeadersVisible) 4399if (_layout.RowHeadersVisible) 4416if (_layout.ColumnHeadersVisible) 4480_layout._dirty = false; 4485Debug.Assert(!_layout._dirty); 4493if (!oldResizeRect.Equals(_layout.ResizeBoxRect) && !_layout.ResizeBoxRect.IsEmpty) 4495Invalidate(_layout.ResizeBoxRect); 4547_vertScrollBar.LargeChange = _layout.Data.Height - totalVisibleFrozenHeight; 4568int displayWidth = _layout.Data.Width, cx = 0; 4720Invalidate(_layout.ColumnHeaders); 4771int displayHeight = _layout.Data.Height; 4923columnX = RightToLeftInternal ? _layout.RowHeaders.Left - 1 : _layout.RowHeaders.Left; 4926rowY = rowIndex > -1 ? GetRowYFromIndex(rowIndex) : _layout.ColumnHeaders.Top; 5522int cxMax = _layout.Data.Width, cx = 0; 5635Rectangle rectInsertionBar = new(0, _layout.ColumnHeaders.Top, InsertionBarWidth, _layout.ColumnHeaders.Height); 5663_layout.ColumnHeaders.X, 5667_layout.ColumnHeaders.Right - InsertionBarWidth); 6049int y = Math.Min(e.Y + _mouseBarOffset, _layout.Data.Bottom - 1); 6050int delta = y - _layout.ColumnHeaders.Y - ColumnHeadersHeight + 1; 6071Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 6113newX = Math.Max(x + _mouseBarOffset, _layout.Data.X); 6118newX = Math.Min(x + _mouseBarOffset, _layout.Data.Right - 1); 6296x = Math.Max(e.X + _mouseBarOffset, _layout.Data.Left - 1); 6297delta = _layout.RowHeaders.Right - RowHeadersWidth - x - 1; 6301x = Math.Min(e.X + _mouseBarOffset, _layout.Data.Right - 1); 6302delta = x - _layout.RowHeaders.X - RowHeadersWidth + 1; 6328int y = Math.Min(e.Y + _mouseBarOffset, _layout.Data.Bottom - 1); 6398int displayHeight = _layout.Data.Height; 7056columnRect = rowIndex >= 0 ? _layout.RowHeaders : _layout.TopLeftHeader; 7067rowRect = columnIndex >= 0 ? _layout.ColumnHeaders : _layout.TopLeftHeader; 8210Rectangle data = _layout.Data; 8308if (_layout.ColumnHeadersVisible) 8310columnRect.Height += _layout.ColumnHeaders.Height; 8311columnRect.Y -= _layout.ColumnHeaders.Height; 8324Rectangle data = _layout.Data; 8456int x = RightToLeftInternal ? _layout.Data.Right - 1 : _layout.Data.X; 8564Rectangle rectScrollingArea = _layout.Data; 8569int emptyBackgroundWidth = Math.Max(0, _layout.Data.Width - Columns.GetColumnsWidth(DataGridViewElementStates.Visible)); 8570int emptyBackgroundHeight = Math.Max(0, _layout.Data.Height - frozenVisibleRowsHeight - trailingScrollingRowsHeight); 8578if (_layout.RowHeadersVisible) 8581rectScrollingArea = Rectangle.Union(rectScrollingArea, _layout.RowHeaders); 8670if (_layout.ColumnHeadersVisible) 8673rectScrollingArea = Rectangle.Union(rectScrollingArea, _layout.ColumnHeaders); 8828if (mouseY < _layout.Data.Top) 8830mouseY = _layout.Data.Top + 1; 8893if (!RightToLeftInternal && mouseX < _layout.Data.Left) 8895mouseX = _layout.Data.Left + 1; 8898else if (RightToLeftInternal && mouseX > _layout.Data.Right) 8900mouseX = _layout.Data.Right - 1; 9040Rectangle data = _layout.Data; 9093if (_layout.RowHeadersVisible) 9095rowRect.Width += _layout.RowHeaders.Width; 9098rowRect.X -= _layout.RowHeaders.Width; 9110Rectangle data = _layout.Data; 9201int y = _layout.Data.Y; 9288if (!_layout.Inside.Contains(x, y)) 9305if (_layout.TopLeftHeader.Contains(x, y)) 9309hti._colStart = RightToLeftInternal ? _layout.TopLeftHeader.Right - 1 : _layout.TopLeftHeader.Left; 9311hti._rowStart = _layout.TopLeftHeader.Top; 9312if ((!RightToLeftInternal && _layout.TopLeftHeader.Right - x < ColumnSizingHotZone) 9313|| (RightToLeftInternal && x - _layout.TopLeftHeader.Left < ColumnSizingHotZone)) 9320? _layout.TopLeftHeader.Left - x - 1 9321: _layout.TopLeftHeader.Right - x - 1; 9324else if (_layout.TopLeftHeader.Top + _layout.TopLeftHeader.Height - y < RowSizingHotZone) 9330hti._mouseBarOffset = _layout.TopLeftHeader.Top + _layout.TopLeftHeader.Height - y - 1; 9338if (_layout.ColumnHeaders.Contains(x, y)) 9350hti._rowStart = _layout.ColumnHeaders.Top; 9401else if (_layout.ColumnHeaders.Bottom - y < RowSizingHotZone) 9407hti._mouseBarOffset = _layout.ColumnHeaders.Bottom - y - 1; 9413if (_layout.RowHeaders.Contains(x, y)) 9425hti._colStart = RightToLeftInternal ? _layout.RowHeaders.Right - 1 : _layout.RowHeaders.Left; 9465else if ((!RightToLeftInternal && _layout.RowHeaders.Right - x < ColumnSizingHotZone) 9466|| (RightToLeftInternal && x - _layout.RowHeaders.Left < ColumnSizingHotZone)) 9473? _layout.RowHeaders.Left - x - 1 9474: _layout.RowHeaders.Right - x - 1; 9479if (_layout.Data.Contains(x, y)) 9831Invalidate(_layout.Data); 9842Invalidate(_layout.Inside); 9899data = _layout.Data; 10172&& totalVisibleWidth > _layout.Data.Width 10173&& totalVisibleFrozenWidth < _layout.Data.Width 10174&& horizScrollBarHeight <= _layout.Data.Height) 10176int oldDataHeight = _layout.Data.Height; 10177_layout.Data.Height -= horizScrollBarHeight; 10178Debug.Assert(_layout.Data.Height >= 0); 10180if (totalVisibleWidth - _layout.Data.Width <= vertScrollBarWidth 10181|| _layout.Data.Width - totalVisibleFrozenWidth <= vertScrollBarWidth) 10190needHorizScrollbar = totalVisibleFrozenWidth < _layout.Data.Width - vertScrollBarWidth; 10198if (_layout.RowHeadersVisible) 10200_layout.RowHeaders.Height -= horizScrollBarHeight; 10201Debug.Assert(_layout.RowHeaders.Height >= 0); 10207_layout.Data.Height = oldDataHeight; 10218&& _layout.Data.Height > totalVisibleFrozenHeight 10219&& vertScrollBarWidth <= _layout.Data.Width) 10221_layout.Data.Width -= vertScrollBarWidth; 10222Debug.Assert(_layout.Data.Width >= 0); 10225_layout.Data.X += vertScrollBarWidth; 10228if (_layout.ColumnHeadersVisible) 10230_layout.ColumnHeaders.Width -= vertScrollBarWidth; 10231Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10234_layout.ColumnHeaders.X += vertScrollBarWidth; 10248&& totalVisibleWidth > _layout.Data.Width && totalVisibleFrozenWidth < _layout.Data.Width 10249&& horizScrollBarHeight <= _layout.Data.Height) 10252if (_layout.ColumnHeadersVisible) 10254_layout.ColumnHeaders.Width += vertScrollBarWidth; 10257_layout.ColumnHeaders.X -= vertScrollBarWidth; 10261_layout.Data.Width += vertScrollBarWidth; 10264_layout.Data.X -= vertScrollBarWidth; 10267_layout.Data.Height -= horizScrollBarHeight; 10268Debug.Assert(_layout.Data.Height >= 0); 10275&& _layout.Data.Height > totalVisibleFrozenHeight 10276&& vertScrollBarWidth <= _layout.Data.Width) 10278_layout.Data.Width -= vertScrollBarWidth; 10279Debug.Assert(_layout.Data.Width >= 0); 10282_layout.Data.X += vertScrollBarWidth; 10285if (_layout.ColumnHeadersVisible) 10287_layout.ColumnHeaders.Width -= vertScrollBarWidth; 10288Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10291_layout.ColumnHeaders.X += vertScrollBarWidth; 10301_layout.ResizeBoxRect = default; 10304_layout.ResizeBoxRect = new Rectangle( 10305rightToLeftInternal ? _layout.Data.X - _vertScrollBar.Width : _layout.Data.Right, 10306_layout.Data.Bottom, 10313int widthNotVisible = totalVisibleWidth - _layout.Data.Width; 10322rightToLeftInternal ? _layout.Inside.X + _layout.ResizeBoxRect.Width : _layout.Inside.X, 10323_layout.Data.Bottom, 10324_layout.Inside.Width - _layout.ResizeBoxRect.Width, 10344int vertScrollBarTop = _layout.Data.Y; 10345int vertScrollBarHeight = _layout.Data.Height; 10346if (_layout.ColumnHeadersVisible) 10348vertScrollBarTop = _layout.ColumnHeaders.Y; 10349vertScrollBarHeight += _layout.ColumnHeaders.Height; 10361_vertScrollBar.LargeChange = _layout.Data.Height - totalVisibleFrozenHeight; 10363rightToLeftInternal ? _layout.Data.X - _vertScrollBar.Width : _layout.Data.Right, 10492Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 13450Invalidate(Rectangle.Union(_layout.ColumnHeaders, _layout.Data)); 13913Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 14490Rectangle rightArea = _layout.Data; 14491if (_layout.ColumnHeadersVisible) 14493rightArea = Rectangle.Union(rightArea, _layout.ColumnHeaders); 15223if (_layout._dirty) 16671if (_layout._dirty) 16701PaintBorder(g, clipRect, _layout.ClientRectangle); 16702if (clipRect.IntersectsWith(_layout.ResizeBoxRect)) 16704g.FillRectangle(SystemBrushes.Control, _layout.ResizeBoxRect); 16740Rectangle gridRect = _layout.Data; 16741if (_layout.RowHeadersVisible) 16743gridRect = Rectangle.Union(gridRect, _layout.RowHeaders); 16755if (_layout.ColumnHeadersVisible) 16757gridRect = Rectangle.Union(gridRect, _layout.ColumnHeaders); 16761if (gridRect.Y == _layout.Data.Y) 17440Rectangle oldClientRectangle = _layout.ClientRectangle; 17501if (!_layout.ResizeBoxRect.IsEmpty) 17503Invalidate(_layout.ResizeBoxRect); 17506_layout.ClientRectangle = newClientRectangle; 18187Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.RowHeaders)); 19211if (_layout.ColumnHeadersVisible) 19213rcBelowRows.Y += _layout.ColumnHeaders.Height; 19214rcBelowRows.Height -= _layout.ColumnHeaders.Height; 19236if (_layout.RowHeadersVisible) 19240rcNextRows.X += _layout.RowHeaders.Width; 19243rcNextRows.Width -= _layout.RowHeaders.Width; 19338if (g.IsVisible(_layout.ColumnHeaders)) 19341bandBounds = cellBounds = _layout.ColumnHeaders; 19497if (_layout.TopLeftHeader.Width > 0 && (clipRect.IntersectsWith(_layout.TopLeftHeader) || _lastHeaderShadow != -1)) 19502g.SetClip(_layout.TopLeftHeader); 19508if (_layout.ColumnHeadersVisible) 19510Rectangle columnHeadersClip = _layout.ColumnHeaders; 19524int columnHeadersHeight = _layout.ColumnHeaders.Height; 19677if (g.IsVisible(_layout.TopLeftHeader)) 19682Rectangle cellBounds = _layout.TopLeftHeader; 19688_layout.TopLeftHeader, 19758_layout?._dirty = true; 19807Rectangle editingZone = _layout.Data; 25544bool matchPositionInCurrencyManagerAfterRecreatingRows = !_layout._dirty && !InSortOperation; 25866Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 26059while (xColumnRightEdge < _layout.Data.X && Columns.DisplayInOrder(firstDisplayedScrollingColumn, columnIndex)) 26068if (xColumnRightEdge < _layout.Data.X) 26080while (xColumnRightEdge > _layout.Data.Right && Columns.DisplayInOrder(firstDisplayedScrollingColumn, columnIndex)) 26089if (xColumnRightEdge > _layout.Data.Right) 26288while (yRowBottomEdge > _layout.Data.Bottom && rowIndex > firstDisplayedScrollingRow) 26292if (yRowBottomEdge > _layout.Data.Bottom) 26331Rectangle rowsRect = _layout.Data; 26332if (_layout.RowHeadersVisible) 26334rowsRect = Rectangle.Union(rowsRect, _layout.RowHeaders); 26371rowsRect.X = _layout.Inside.X; 26372rowsRect.Y = _layout.Inside.Y; 26373rowsRect.Width = _layout.RowHeaders.Width; 26726if (_layout.ColumnHeadersVisible) 28934if (IsHandleCreated && _layout.RowHeadersVisible) 28950if (IsHandleCreated && _layout.RowHeadersVisible) 28958Invalidate(_layout.RowHeaders); 29002Rectangle bottomArea = _layout.Data; 29003if (_layout.RowHeadersVisible) 29005bottomArea = Rectangle.Union(bottomArea, _layout.RowHeaders); 29077Rectangle bottomArea = _layout.Data; 29078if (_layout.RowHeadersVisible) 29080bottomArea = Rectangle.Union(bottomArea, _layout.RowHeaders);
System\Windows\Forms\Controls\DataGridView\DataGridView.TopRowAccessibleObject.cs (2)
37Rectangle rect = Rectangle.Union(_ownerDataGridView._layout.ColumnHeaders, _ownerDataGridView._layout.TopLeftHeader);