DataGridViewCell.AdjustCellBorderStyle(DataGridViewAdvancedBorderStyle, DataGridViewAdvancedBorderStyle, Boolean, Boolean, Boolean, Boolean) Methode

Definition

Ändert die Rahmenart der Eingabezelle entsprechend den angegebenen Kriterien.Modifies the input cell border style according to the specified criteria.

public:
 virtual System::Windows::Forms::DataGridViewAdvancedBorderStyle ^ AdjustCellBorderStyle(System::Windows::Forms::DataGridViewAdvancedBorderStyle ^ dataGridViewAdvancedBorderStyleInput, System::Windows::Forms::DataGridViewAdvancedBorderStyle ^ dataGridViewAdvancedBorderStylePlaceholder, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow);
public virtual System.Windows.Forms.DataGridViewAdvancedBorderStyle AdjustCellBorderStyle (System.Windows.Forms.DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStyleInput, System.Windows.Forms.DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStylePlaceholder, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow);
abstract member AdjustCellBorderStyle : System.Windows.Forms.DataGridViewAdvancedBorderStyle * System.Windows.Forms.DataGridViewAdvancedBorderStyle * bool * bool * bool * bool -> System.Windows.Forms.DataGridViewAdvancedBorderStyle
override this.AdjustCellBorderStyle : System.Windows.Forms.DataGridViewAdvancedBorderStyle * System.Windows.Forms.DataGridViewAdvancedBorderStyle * bool * bool * bool * bool -> System.Windows.Forms.DataGridViewAdvancedBorderStyle
Public Overridable Function AdjustCellBorderStyle (dataGridViewAdvancedBorderStyleInput As DataGridViewAdvancedBorderStyle, dataGridViewAdvancedBorderStylePlaceholder As DataGridViewAdvancedBorderStyle, singleVerticalBorderAdded As Boolean, singleHorizontalBorderAdded As Boolean, isFirstDisplayedColumn As Boolean, isFirstDisplayedRow As Boolean) As DataGridViewAdvancedBorderStyle

Parameter

dataGridViewAdvancedBorderStyleInput
DataGridViewAdvancedBorderStyle

Ein DataGridViewAdvancedBorderStyle, der die zu ändernde Zellrahmenart darstellt.A DataGridViewAdvancedBorderStyle that represents the cell border style to modify.

dataGridViewAdvancedBorderStylePlaceholder
DataGridViewAdvancedBorderStyle

Ein DataGridViewAdvancedBorderStyle, in dem Zwischenänderungen an der Rahmenart der Zelle gespeichert werden.A DataGridViewAdvancedBorderStyle that is used to store intermediate changes to the cell border style.

singleVerticalBorderAdded
Boolean

true, um der Zelle eine vertikale Rahmenlinie hinzuzufügen, andernfalls false.true to add a vertical border to the cell; otherwise, false.

singleHorizontalBorderAdded
Boolean

true, um der Zelle eine horizontale Rahmenlinie hinzuzufügen, andernfalls false.true to add a horizontal border to the cell; otherwise, false.

isFirstDisplayedColumn
Boolean

true, wenn sich die Hostzelle in der ersten sichtbaren Spalte befindet, andernfalls false.true if the hosting cell is in the first visible column; otherwise, false.

isFirstDisplayedRow
Boolean

true, wenn sich die Hostzelle in der ersten sichtbaren Zeile befindet, andernfalls false.true if the hosting cell is in the first visible row; otherwise, false.

Gibt zurück

Beispiele

Im folgenden Codebeispiel wird veranschaulicht, wie die AdjustCellBorderStyle-Methode überschrieben wird, um die Rahmen der Zellen anzupassen.The following code example demonstrates how to override the AdjustCellBorderStyle method to customize the borders of the cells. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die DataGridViewAdvancedBorderStyle-Klasse bereitgestellt wird.This code example is part of a larger example provided for the DataGridViewAdvancedBorderStyle class.

public override DataGridViewAdvancedBorderStyle AdjustCellBorderStyle(
    DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStyleInput,
    DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStylePlaceHolder,
    bool singleVerticalBorderAdded,
    bool singleHorizontalBorderAdded,
    bool firstVisibleColumn,
    bool firstVisibleRow)
{
    // Customize the top border of cells in the first row and the 
    // right border of cells in the first column. Use the input style 
    // for all other borders.
    dataGridViewAdvancedBorderStylePlaceHolder.Left = firstVisibleColumn ?
        DataGridViewAdvancedCellBorderStyle.OutsetDouble :
        DataGridViewAdvancedCellBorderStyle.None;
    dataGridViewAdvancedBorderStylePlaceHolder.Top = firstVisibleRow ?
        DataGridViewAdvancedCellBorderStyle.InsetDouble :
        DataGridViewAdvancedCellBorderStyle.None;

    dataGridViewAdvancedBorderStylePlaceHolder.Right =
        dataGridViewAdvancedBorderStyleInput.Right;
    dataGridViewAdvancedBorderStylePlaceHolder.Bottom =
        dataGridViewAdvancedBorderStyleInput.Bottom;

    return dataGridViewAdvancedBorderStylePlaceHolder;
}
    Public Overrides Function AdjustCellBorderStyle( _
        ByVal dataGridViewAdvancedBorderStyleInput As DataGridViewAdvancedBorderStyle, _
        ByVal dataGridViewAdvancedBorderStylePlaceHolder As DataGridViewAdvancedBorderStyle, _
        ByVal singleVerticalBorderAdded As Boolean, _
        ByVal singleHorizontalBorderAdded As Boolean, _
        ByVal firstVisibleColumn As Boolean, _
        ByVal firstVisibleRow As Boolean) As DataGridViewAdvancedBorderStyle

        ' Customize the top border of cells in the first row and the 
        ' right border of cells in the first column. Use the input style 
        ' for all other borders.
        If firstVisibleColumn Then
            dataGridViewAdvancedBorderStylePlaceHolder.Left = _
                DataGridViewAdvancedCellBorderStyle.OutsetDouble
        Else
            dataGridViewAdvancedBorderStylePlaceHolder.Left = _
                DataGridViewAdvancedCellBorderStyle.None
        End If

        If firstVisibleRow Then
            dataGridViewAdvancedBorderStylePlaceHolder.Top = _
                DataGridViewAdvancedCellBorderStyle.InsetDouble
        Else
            dataGridViewAdvancedBorderStylePlaceHolder.Top = _
                DataGridViewAdvancedCellBorderStyle.None
        End If

        With dataGridViewAdvancedBorderStylePlaceHolder
            .Right = dataGridViewAdvancedBorderStyleInput.Right
            .Bottom = dataGridViewAdvancedBorderStyleInput.Bottom
        End With

        Return dataGridViewAdvancedBorderStylePlaceHolder
    End Function
End Class

Hinweise

Das DataGridView-Steuerelement ruft intern die AdjustCellBorderStyle-Methode auf, um die Darstellung der Zell Rahmen zu bestimmen.The DataGridView control internally calls the AdjustCellBorderStyle method to determine the appearance of the cell borders. Das DataGridView-Steuerelement verwendet in der Regel den Wert der AdvancedCellBorderStyle-Eigenschaft für den dataGridViewAdvancedBorderStyleInput-Parameter.The DataGridView control typically uses the value of the AdvancedCellBorderStyle property for the dataGridViewAdvancedBorderStyleInput parameter.

Der DataGridViewAdvancedCellBorderStyle.OutsetPartial-Wert wird als Eingabe Stil für Zellen nicht unterstützt.The DataGridViewAdvancedCellBorderStyle.OutsetPartial value is not supported as an input style for cells.

Hinweise für Vererber

Überschreiben Sie diese Methode, wenn Sie die Darstellung der Zell Rahmen anpassen möchten.Override this method if you want to customize the appearance of the cell borders.

Gilt für:

Siehe auch