DataGridView.AdjustColumnHeaderBorderStyle(DataGridViewAdvancedBorderStyle, DataGridViewAdvancedBorderStyle, Boolean, Boolean) Método

Definición

Ajusta el valor de DataGridViewAdvancedBorderStyle para una celda de encabezado de columna de un control DataGridView que se está dibujando actualmente.Adjusts the DataGridViewAdvancedBorderStyle for a column header cell of a DataGridView that is currently being painted.

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

Parámetros

dataGridViewAdvancedBorderStyleInput
DataGridViewAdvancedBorderStyle

Elemento DataGridViewAdvancedBorderStyle que representa el estilo del borde del encabezado de la columna que se va a modificar.A DataGridViewAdvancedBorderStyle that represents the column header border style to modify.

dataGridViewAdvancedBorderStylePlaceholder
DataGridViewAdvancedBorderStyle

DataGridViewAdvancedBorderStyle que se usa para almacenar los cambios intermedios realizados en el estilo de borde de encabezado de columna.A DataGridViewAdvancedBorderStyle that is used to store intermediate changes to the column header border style.

isFirstDisplayedColumn
Boolean

Estrue para indicar que el objeto DataGridViewCell que se está dibujando actualmente está en la primera columna mostrada en el control DataGridView; en caso contrario, es false.true to indicate that the DataGridViewCell that is currently being painted is in the first column displayed on the DataGridView; otherwise, false.

isLastVisibleColumn
Boolean

Es true para indicar que el objeto DataGridViewCell que se está dibujando actualmente está en el control DataGridView cuya propiedad Visible está establecida en true; en caso contrario, es false.true to indicate that the DataGridViewCell that is currently being painted is in the last column in the DataGridView that has the Visible property set to true; otherwise, false.

Devoluciones

DataGridViewAdvancedBorderStyle que representa el estilo de borde del encabezado de columna actual.A DataGridViewAdvancedBorderStyle that represents the border style for the current column header.

Ejemplos

En el ejemplo de código siguiente se muestra cómo invalidar el método AdjustColumnHeaderBorderStyle para personalizar los bordes de las celdas de encabezado de columna.The following code example demonstrates how to override the AdjustColumnHeaderBorderStyle method to customize the borders of the column header cells. Este ejemplo de código forma parte de un ejemplo más extenso proporcionado para la clase DataGridViewAdvancedBorderStyle.This code example is part of a larger example provided for the DataGridViewAdvancedBorderStyle class.

public override DataGridViewAdvancedBorderStyle AdjustColumnHeaderBorderStyle(
    DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStyleInput,
    DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStylePlaceHolder,
    bool firstDisplayedColumn,
    bool lastVisibleColumn)
{
    // Customize the left border of the first column header and the
    // bottom border of all the column headers. Use the input style for 
    // all other borders.
    dataGridViewAdvancedBorderStylePlaceHolder.Left = firstDisplayedColumn ?
        DataGridViewAdvancedCellBorderStyle.OutsetDouble :
        DataGridViewAdvancedCellBorderStyle.None;
    dataGridViewAdvancedBorderStylePlaceHolder.Bottom =
        DataGridViewAdvancedCellBorderStyle.Single;

    dataGridViewAdvancedBorderStylePlaceHolder.Right =
        dataGridViewAdvancedBorderStyleInput.Right;
    dataGridViewAdvancedBorderStylePlaceHolder.Top =
        dataGridViewAdvancedBorderStyleInput.Top;

    return dataGridViewAdvancedBorderStylePlaceHolder;
}
    Public Overrides Function AdjustColumnHeaderBorderStyle( _
        ByVal dataGridViewAdvancedBorderStyleInput As DataGridViewAdvancedBorderStyle, _
        ByVal dataGridViewAdvancedBorderStylePlaceHolder As DataGridViewAdvancedBorderStyle, _
        ByVal firstDisplayedColumn As Boolean, ByVal lastVisibleColumn As Boolean) _
        As DataGridViewAdvancedBorderStyle

        ' Customize the left border of the first column header and the
        ' bottom border of all the column headers. Use the input style for 
        ' all other borders.
        If firstDisplayedColumn Then
            dataGridViewAdvancedBorderStylePlaceHolder.Left = _
                DataGridViewAdvancedCellBorderStyle.OutsetDouble
        Else
            dataGridViewAdvancedBorderStylePlaceHolder.Left = _
                DataGridViewAdvancedCellBorderStyle.None
        End If

        With dataGridViewAdvancedBorderStylePlaceHolder
            .Bottom = DataGridViewAdvancedCellBorderStyle.Single
            .Right = dataGridViewAdvancedBorderStyleInput.Right
            .Top = dataGridViewAdvancedBorderStyleInput.Top
        End With

        Return dataGridViewAdvancedBorderStylePlaceHolder
    End Function
End Class

Comentarios

El control DataGridView llama internamente al método AdjustColumnHeaderBorderStyle para determinar la apariencia de los bordes de las celdas de encabezado de columna.The DataGridView control internally calls the AdjustColumnHeaderBorderStyle method to determine the appearance of the borders for the column header cells. Normalmente, el control DataGridView usa el valor de la propiedad AdvancedColumnHeadersBorderStyle para el parámetro dataGridViewAdvancedBorderStyleInput.The DataGridView control typically uses the value of the AdvancedColumnHeadersBorderStyle property for the dataGridViewAdvancedBorderStyleInput parameter.

Notas a los desarrolladores de herederos

Invalide este método si desea personalizar la apariencia del borde en las celdas de encabezado de columna.Override this method if you want to customize the appearance of the border on column header cells.

Se aplica a

Consulte también: