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