3 writes to _layout
System.Windows.Forms (3)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
449_layout = new LayoutData
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (2)
4535_layout = newLayout; 4540_layout = newLayout;
302 references to _layout
System.Windows.Forms (302)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (24)
1675_layout.ColumnHeadersVisible = value; 2474int displayWidth = _layout.Data.Width; 2554int displayHeight = _layout.Data.Height; 2687int widthNotVisible = Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - _layout.Data.Width; 2710Rectangle rectTmp = _layout.Data; 2711if (_layout.ColumnHeadersVisible) 2714rectTmp = Rectangle.Union(rectTmp, _layout.ColumnHeaders); 2809if (value > 0 && (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - _layout.Data.Width) <= 0) 2981if (_layout._dirty && IsHandleCreated) 2990return _layout; 3364_layout.RowHeadersVisible = value; 3420if (_layout.RowHeadersVisible) 3819if (!_layout._dirty && !DesignMode) 3821Invalidate(Rectangle.Union(_layout.Data, _layout.ColumnHeaders)); 3822Invalidate(_layout.TopLeftHeader); 3872if (!_layout._dirty && !DesignMode) 3874Invalidate(_layout.Data); 3952if (!_layout._dirty && !DesignMode) 3954Invalidate(_layout.RowHeaders); 3961!_layout.ColumnHeadersVisible 3966!_layout.RowHeadersVisible 4076Invalidate(new Rectangle(_layout.Inside.X, _layout.Inside.Y, RowHeadersWidth, ColumnHeadersHeight));
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (276)
539int displayHeight = _layout.Data.Height; 583Debug.Assert(!_layout._dirty); 585if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) > _layout.Data.Width) 593int availableWidth = _layout.Data.Width; // Width available for auto-filled columns 639int maximumPossibleWidth = _layout.Data.Width - imposedWidthSum; 793int maximumPossibleWidth = _layout.Data.Width - imposedWidthSum; 970Debug.Assert(_layout.Data.Width == _layout.Inside.Width - _layout.RowHeaders.Width - (SingleVerticalBorderAdded ? 1 : 0)); 971int availableWidth = _layout.Data.Width - imposedWidthSum; 984&& _layout.Data.Height > totalVisibleFrozenHeight 985&& SystemInformation.VerticalScrollBarWidth <= _layout.Data.Width) 1365int displayHeight = _layout.Data.Height; 1802if (_layout.TopLeftHeader.Width > 0) 1805? TopLeftHeaderCell.GetPreferredHeight(-1, _layout.TopLeftHeader.Width) 1867if (_layout.TopLeftHeader.Width > 0) 1870? TopLeftHeaderCell.GetPreferredHeight(-1, _layout.TopLeftHeader.Width) 2060if (_layout.TopLeftHeader.Width > 0) 2063? TopLeftHeaderCell.GetPreferredWidth(-1, _layout.TopLeftHeader.Height) 2084int displayHeight = _layout.Data.Height, cy = 0; 2222if (_layout.TopLeftHeader.Width > 0) 2225? TopLeftHeaderCell.GetPreferredWidth(-1, _layout.TopLeftHeader.Height) 2246int displayHeight = _layout.Data.Height, cy = 0; 2476Rectangle clip = Rectangle.Union(_layout.ColumnHeaders, _layout.Data); 2477if (_layout.TopLeftHeader.Width > 0) 2479clip = Rectangle.Union(_layout.TopLeftHeader, clip); 2500Rectangle cursorClip = _layout.ColumnHeaders; 2511cursorClip.Width = Math.Min(frozenWidth, _layout.Data.Width); 2520else if (_layout.Data.Width > frozenWidth + scrollingWidth) 2522cursorClip.X += _layout.Data.Width - frozenWidth - scrollingWidth; 2525cursorClip.Width = Math.Min(scrollingWidth, _layout.Data.Width); 2536Invalidate(_layout.ColumnHeaders); 2582Rectangle clip = Rectangle.Union(_layout.ColumnHeaders, _layout.Data); 2586clip.X = _layout.Data.X - _mouseBarOffset - 1; 2587clip.Width = leftEdge - Columns[columnIndex].MinimumThickness - _layout.Data.X + 3; 2598clip.Width = _layout.Data.Right - leftEdge - 1; 2781Rectangle clip = Rectangle.Union(_layout.RowHeaders, _layout.Data); 2782if (_layout.TopLeftHeader.Width > 0) 2784clip = Rectangle.Union(_layout.TopLeftHeader, clip); 2816Rectangle clip = Rectangle.Union(_layout.RowHeaders, _layout.Data); 2819clip.Height = _layout.Data.Y + _layout.Data.Height - topEdge - 1; 3026Rectangle r, inside = _layout.ColumnHeaders; 3027if (_layout.TopLeftHeader.Width > 0) 3029inside = Rectangle.Union(_layout.TopLeftHeader, inside); 3058Rectangle inside = _layout.Data; 3079Rectangle inside = _layout.Data; 4270if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen) >= _layout.Data.Width) 4328int displayHeight = _layout.Data.Height - totalVisibleFrozenHeight; 4417LayoutData newLayout = new(_layout); 4418Rectangle oldResizeRect = _layout.ResizeBoxRect; 4441if (_layout.ColumnHeadersVisible) 4455if (_layout.RowHeadersVisible) 4472if (_layout.ColumnHeadersVisible) 4536_layout._dirty = false; 4541Debug.Assert(!_layout._dirty); 4549if (!oldResizeRect.Equals(_layout.ResizeBoxRect) && !_layout.ResizeBoxRect.IsEmpty) 4551Invalidate(_layout.ResizeBoxRect); 4603_vertScrollBar.LargeChange = _layout.Data.Height - totalVisibleFrozenHeight; 4624int displayWidth = _layout.Data.Width, cx = 0; 4776Invalidate(_layout.ColumnHeaders); 4827int displayHeight = _layout.Data.Height; 4979columnX = RightToLeftInternal ? _layout.RowHeaders.Left - 1 : _layout.RowHeaders.Left; 4982rowY = rowIndex > -1 ? GetRowYFromIndex(rowIndex) : _layout.ColumnHeaders.Top; 5578int cxMax = _layout.Data.Width, cx = 0; 5691Rectangle rectInsertionBar = new(0, _layout.ColumnHeaders.Top, InsertionBarWidth, _layout.ColumnHeaders.Height); 5719_layout.ColumnHeaders.X, 5723_layout.ColumnHeaders.Right - InsertionBarWidth); 6105int y = Math.Min(e.Y + _mouseBarOffset, _layout.Data.Bottom - 1); 6106int delta = y - _layout.ColumnHeaders.Y - ColumnHeadersHeight + 1; 6127Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 6169newX = Math.Max(x + _mouseBarOffset, _layout.Data.X); 6174newX = Math.Min(x + _mouseBarOffset, _layout.Data.Right - 1); 6352x = Math.Max(e.X + _mouseBarOffset, _layout.Data.Left - 1); 6353delta = _layout.RowHeaders.Right - RowHeadersWidth - x - 1; 6357x = Math.Min(e.X + _mouseBarOffset, _layout.Data.Right - 1); 6358delta = x - _layout.RowHeaders.X - RowHeadersWidth + 1; 6384int y = Math.Min(e.Y + _mouseBarOffset, _layout.Data.Bottom - 1); 6454int displayHeight = _layout.Data.Height; 7112columnRect = rowIndex >= 0 ? _layout.RowHeaders : _layout.TopLeftHeader; 7123rowRect = columnIndex >= 0 ? _layout.ColumnHeaders : _layout.TopLeftHeader; 8266Rectangle data = _layout.Data; 8364if (_layout.ColumnHeadersVisible) 8366columnRect.Height += _layout.ColumnHeaders.Height; 8367columnRect.Y -= _layout.ColumnHeaders.Height; 8380Rectangle data = _layout.Data; 8512int x = RightToLeftInternal ? _layout.Data.Right - 1 : _layout.Data.X; 8620Rectangle rectScrollingArea = _layout.Data; 8625int emptyBackgroundWidth = Math.Max(0, _layout.Data.Width - Columns.GetColumnsWidth(DataGridViewElementStates.Visible)); 8626int emptyBackgroundHeight = Math.Max(0, _layout.Data.Height - frozenVisibleRowsHeight - trailingScrollingRowsHeight); 8634if (_layout.RowHeadersVisible) 8637rectScrollingArea = Rectangle.Union(rectScrollingArea, _layout.RowHeaders); 8726if (_layout.ColumnHeadersVisible) 8729rectScrollingArea = Rectangle.Union(rectScrollingArea, _layout.ColumnHeaders); 8884if (mouseY < _layout.Data.Top) 8886mouseY = _layout.Data.Top + 1; 8949if (!RightToLeftInternal && mouseX < _layout.Data.Left) 8951mouseX = _layout.Data.Left + 1; 8954else if (RightToLeftInternal && mouseX > _layout.Data.Right) 8956mouseX = _layout.Data.Right - 1; 9096Rectangle data = _layout.Data; 9149if (_layout.RowHeadersVisible) 9151rowRect.Width += _layout.RowHeaders.Width; 9154rowRect.X -= _layout.RowHeaders.Width; 9166Rectangle data = _layout.Data; 9257int y = _layout.Data.Y; 9344if (!_layout.Inside.Contains(x, y)) 9361if (_layout.TopLeftHeader.Contains(x, y)) 9365hti._colStart = RightToLeftInternal ? _layout.TopLeftHeader.Right - 1 : _layout.TopLeftHeader.Left; 9367hti._rowStart = _layout.TopLeftHeader.Top; 9368if ((!RightToLeftInternal && _layout.TopLeftHeader.Right - x < ColumnSizingHotZone) 9369|| (RightToLeftInternal && x - _layout.TopLeftHeader.Left < ColumnSizingHotZone)) 9376? _layout.TopLeftHeader.Left - x - 1 9377: _layout.TopLeftHeader.Right - x - 1; 9380else if (_layout.TopLeftHeader.Top + _layout.TopLeftHeader.Height - y < RowSizingHotZone) 9386hti._mouseBarOffset = _layout.TopLeftHeader.Top + _layout.TopLeftHeader.Height - y - 1; 9394if (_layout.ColumnHeaders.Contains(x, y)) 9406hti._rowStart = _layout.ColumnHeaders.Top; 9457else if (_layout.ColumnHeaders.Bottom - y < RowSizingHotZone) 9463hti._mouseBarOffset = _layout.ColumnHeaders.Bottom - y - 1; 9469if (_layout.RowHeaders.Contains(x, y)) 9481hti._colStart = RightToLeftInternal ? _layout.RowHeaders.Right - 1 : _layout.RowHeaders.Left; 9521else if ((!RightToLeftInternal && _layout.RowHeaders.Right - x < ColumnSizingHotZone) 9522|| (RightToLeftInternal && x - _layout.RowHeaders.Left < ColumnSizingHotZone)) 9529? _layout.RowHeaders.Left - x - 1 9530: _layout.RowHeaders.Right - x - 1; 9535if (_layout.Data.Contains(x, y)) 9887Invalidate(_layout.Data); 9898Invalidate(_layout.Inside); 9955data = _layout.Data; 10228&& totalVisibleWidth > _layout.Data.Width 10229&& totalVisibleFrozenWidth < _layout.Data.Width 10230&& horizScrollBarHeight <= _layout.Data.Height) 10232int oldDataHeight = _layout.Data.Height; 10233_layout.Data.Height -= horizScrollBarHeight; 10234Debug.Assert(_layout.Data.Height >= 0); 10236if (totalVisibleWidth - _layout.Data.Width <= vertScrollBarWidth 10237|| _layout.Data.Width - totalVisibleFrozenWidth <= vertScrollBarWidth) 10246needHorizScrollbar = totalVisibleFrozenWidth < _layout.Data.Width - vertScrollBarWidth; 10254if (_layout.RowHeadersVisible) 10256_layout.RowHeaders.Height -= horizScrollBarHeight; 10257Debug.Assert(_layout.RowHeaders.Height >= 0); 10263_layout.Data.Height = oldDataHeight; 10274&& _layout.Data.Height > totalVisibleFrozenHeight 10275&& vertScrollBarWidth <= _layout.Data.Width) 10277_layout.Data.Width -= vertScrollBarWidth; 10278Debug.Assert(_layout.Data.Width >= 0); 10281_layout.Data.X += vertScrollBarWidth; 10284if (_layout.ColumnHeadersVisible) 10286_layout.ColumnHeaders.Width -= vertScrollBarWidth; 10287Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10290_layout.ColumnHeaders.X += vertScrollBarWidth; 10304&& totalVisibleWidth > _layout.Data.Width && totalVisibleFrozenWidth < _layout.Data.Width 10305&& horizScrollBarHeight <= _layout.Data.Height) 10308if (_layout.ColumnHeadersVisible) 10310_layout.ColumnHeaders.Width += vertScrollBarWidth; 10313_layout.ColumnHeaders.X -= vertScrollBarWidth; 10317_layout.Data.Width += vertScrollBarWidth; 10320_layout.Data.X -= vertScrollBarWidth; 10323_layout.Data.Height -= horizScrollBarHeight; 10324Debug.Assert(_layout.Data.Height >= 0); 10331&& _layout.Data.Height > totalVisibleFrozenHeight 10332&& vertScrollBarWidth <= _layout.Data.Width) 10334_layout.Data.Width -= vertScrollBarWidth; 10335Debug.Assert(_layout.Data.Width >= 0); 10338_layout.Data.X += vertScrollBarWidth; 10341if (_layout.ColumnHeadersVisible) 10343_layout.ColumnHeaders.Width -= vertScrollBarWidth; 10344Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10347_layout.ColumnHeaders.X += vertScrollBarWidth; 10357_layout.ResizeBoxRect = default; 10360_layout.ResizeBoxRect = new Rectangle( 10361rightToLeftInternal ? _layout.Data.X - _vertScrollBar.Width : _layout.Data.Right, 10362_layout.Data.Bottom, 10369int widthNotVisible = totalVisibleWidth - _layout.Data.Width; 10378rightToLeftInternal ? _layout.Inside.X + _layout.ResizeBoxRect.Width : _layout.Inside.X, 10379_layout.Data.Bottom, 10380_layout.Inside.Width - _layout.ResizeBoxRect.Width, 10400int vertScrollBarTop = _layout.Data.Y; 10401int vertScrollBarHeight = _layout.Data.Height; 10402if (_layout.ColumnHeadersVisible) 10404vertScrollBarTop = _layout.ColumnHeaders.Y; 10405vertScrollBarHeight += _layout.ColumnHeaders.Height; 10417_vertScrollBar.LargeChange = _layout.Data.Height - totalVisibleFrozenHeight; 10419rightToLeftInternal ? _layout.Data.X - _vertScrollBar.Width : _layout.Data.Right, 10548Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 13506Invalidate(Rectangle.Union(_layout.ColumnHeaders, _layout.Data)); 13969Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 14546Rectangle rightArea = _layout.Data; 14547if (_layout.ColumnHeadersVisible) 14549rightArea = Rectangle.Union(rightArea, _layout.ColumnHeaders); 15279if (_layout._dirty) 16733if (_layout._dirty) 16763PaintBorder(g, clipRect, _layout.ClientRectangle); 16764if (clipRect.IntersectsWith(_layout.ResizeBoxRect)) 16766g.FillRectangle(SystemBrushes.Control, _layout.ResizeBoxRect); 16802Rectangle gridRect = _layout.Data; 16803if (_layout.RowHeadersVisible) 16805gridRect = Rectangle.Union(gridRect, _layout.RowHeaders); 16817if (_layout.ColumnHeadersVisible) 16819gridRect = Rectangle.Union(gridRect, _layout.ColumnHeaders); 16823if (gridRect.Y == _layout.Data.Y) 17502Rectangle oldClientRectangle = _layout.ClientRectangle; 17563if (!_layout.ResizeBoxRect.IsEmpty) 17565Invalidate(_layout.ResizeBoxRect); 17568_layout.ClientRectangle = newClientRectangle; 18249Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.RowHeaders)); 19273if (_layout.ColumnHeadersVisible) 19275rcBelowRows.Y += _layout.ColumnHeaders.Height; 19276rcBelowRows.Height -= _layout.ColumnHeaders.Height; 19298if (_layout.RowHeadersVisible) 19302rcNextRows.X += _layout.RowHeaders.Width; 19305rcNextRows.Width -= _layout.RowHeaders.Width; 19400if (g.IsVisible(_layout.ColumnHeaders)) 19403bandBounds = cellBounds = _layout.ColumnHeaders; 19559if (_layout.TopLeftHeader.Width > 0 && (clipRect.IntersectsWith(_layout.TopLeftHeader) || _lastHeaderShadow != -1)) 19564g.SetClip(_layout.TopLeftHeader); 19570if (_layout.ColumnHeadersVisible) 19572Rectangle columnHeadersClip = _layout.ColumnHeaders; 19586int columnHeadersHeight = _layout.ColumnHeaders.Height; 19739if (g.IsVisible(_layout.TopLeftHeader)) 19744Rectangle cellBounds = _layout.TopLeftHeader; 19750_layout.TopLeftHeader, 19820_layout?._dirty = true; 19869Rectangle editingZone = _layout.Data; 25614bool matchPositionInCurrencyManagerAfterRecreatingRows = !_layout._dirty && !InSortOperation; 25936Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 26129while (xColumnRightEdge < _layout.Data.X && Columns.DisplayInOrder(firstDisplayedScrollingColumn, columnIndex)) 26138if (xColumnRightEdge < _layout.Data.X) 26150while (xColumnRightEdge > _layout.Data.Right && Columns.DisplayInOrder(firstDisplayedScrollingColumn, columnIndex)) 26159if (xColumnRightEdge > _layout.Data.Right) 26358while (yRowBottomEdge > _layout.Data.Bottom && rowIndex > firstDisplayedScrollingRow) 26362if (yRowBottomEdge > _layout.Data.Bottom) 26401Rectangle rowsRect = _layout.Data; 26402if (_layout.RowHeadersVisible) 26404rowsRect = Rectangle.Union(rowsRect, _layout.RowHeaders); 26441rowsRect.X = _layout.Inside.X; 26442rowsRect.Y = _layout.Inside.Y; 26443rowsRect.Width = _layout.RowHeaders.Width; 26796if (_layout.ColumnHeadersVisible) 29004if (IsHandleCreated && _layout.RowHeadersVisible) 29020if (IsHandleCreated && _layout.RowHeadersVisible) 29028Invalidate(_layout.RowHeaders); 29072Rectangle bottomArea = _layout.Data; 29073if (_layout.RowHeadersVisible) 29075bottomArea = Rectangle.Union(bottomArea, _layout.RowHeaders); 29147Rectangle bottomArea = _layout.Data; 29148if (_layout.RowHeadersVisible) 29150bottomArea = Rectangle.Union(bottomArea, _layout.RowHeaders);
System\Windows\Forms\Controls\DataGridView\DataGridView.TopRowAccessibleObject.cs (2)
37Rectangle rect = Rectangle.Union(_ownerDataGridView._layout.ColumnHeaders, _ownerDataGridView._layout.TopLeftHeader);